.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
Sgraph Infotech
Imran Ghani
Post New Web Links

Maintain users and groups list of Active Directory for an asp.net web application only

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :ASP.Net
 
Hi, I have configured active directory in my server 2008. We have a web project using asp.net mvc named Audit planning and Execution Software(Apex2).What we want to do is to authenticate Active directory users for this project.I can get all active directory users, groups, users of a group etc.I want to add users in active directory for the Apex2 project only using asp.net.I also want to display only the users and groups of Active Directory registered with the Apex2 project only. And I also want to add active directory users from whole AD list to our project's AD list. Can you please tell me, how will I do this. Shall I create an Organizational Unit and maintain all users and groups there for our project? Or, is there any other way to do this?  please help me.Thank You


View Complete Post


More Related Resource Links

Getting list of users reporting from specific Manager from Active Directory

  

Dear All,


I am have requirement like displaying all the user information reporting to specific manager from Active Directory.


Please help me regarding this.


Regards

Prakash


List Users from Active Directory

  

When i try to List the users from Active directory, i get this exception.

Error while processing.System.Runtime.InteropServices.COMException (0x80072020): An operations error occurred at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) at System.DirectoryServices.DirectoryEntry.Bind() at System.DirectoryServices.DirectoryEntry.get_AdsObject() at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne) at System.DirectoryServices.DirectorySearcher.FindAll()

The code i used is :

DirectoryEntry de = new DirectoryEntry(_path);DirectorySearcher deSearch = new DirectorySearcher();

deSearch.SearchRoot =de;

deSearch.Filter = "(&(objectClass=user) (cn=" + UserName +"))";

SearchResultCollection results = deSearch.FindAll();

 But the DirectoyEntry method is getting validated if i use the overloaded method : DirectoryEntry(_path, domainAndUsername, password);

Please advice me.

Function retrieving users by country against (Active Directory) LDAP

  
Hello I've got such openquery SELECT * FROM Openquery(ADSI, 'SELECT EmployeeID, displayname, mailAddress, country FROM '' LDAP://MY-LDAP-PATH '' WHERE country=''coutry_code' '   ') country_code is 3 letters i think sth in format like USA, FRA etc I will need to retrieve users from up to 3 countries let say and i would like to create from this query above a stored procedure (or better a FUNCTION)  where someone calling a function can specify from which country does he/she wants to terieve users - when none country specified a function should retrieve users from all 3 let say. I'm not very advanced in programming in T-SQL yet so my question is -> can the variable be specified inside Openquery ? like for example SELECT * FROM Openquery(ADSI, 'SELECT EmployeeID, displayname, mailAddress, country FROM '' LDAP://MY-LDAP-PATH '' WHERE country=''@country' '   ') ACTIVE DIRECTORY HAS LIMITION OF RETRIEVING 1000 RECORDS AT ONCE - BUT NONE OF THESE COUNTRIES HAVE MORE THAN COUPLE HUNDREDS HOVWEVER summing them in one query this number of course will exceed 1000 recoreds so queries i think should be splitted and joined with union ??? Can anyone provide some example code of such function  The other problem i have is that openquery againt ADSI  above works correctly when i use SSMS localy on the server (connectin

Function retrieving users by country against (Active Directory) LDAP

  
Hello I've got such openquery SELECT * FROM Openquery(ADSI, 'SELECT EmployeeID, displayname, mailAddress, country FROM '' LDAP://MY-LDAP-PATH '' WHERE country=''coutry_code' '   ') country_code is 3 letters i think sth in format like USA, FRA etc I will need to retrieve users from up to 3 countries let say and i would like to create from this query above a stored procedure (or better a FUNCTION)  where someone calling a function can specify from which country does he/she wants to terieve users - when none country specified a function should retrieve users from all 3 let say. I'm not very advanced in programming in T-SQL yet so my question is -> can the variable be specified inside Openquery ? like for example SELECT * FROM Openquery(ADSI, 'SELECT EmployeeID, displayname, mailAddress, country FROM '' LDAP://MY-LDAP-PATH '' WHERE country=''@country' '   ') ACTIVE DIRECTORY HAS LIMITION OF RETRIEVING 1000 RECORDS AT ONCE - BUT NONE OF THESE COUNTRIES HAVE MORE THAN COUPLE HUNDREDS HOVWEVER summing them in one query this number of course will exceed 1000 recoreds so queries i think should be splitted and joined with union ??? Can anyone provide some example code of such function  The other problem i have is that openquery againt ADSI  above works correctly when i use SSMS localy on the server (connectin

how to create groups for the active directory

  
hello guys,For my web application i have use the directory services to authenticate the users ,every thing works gr8 ,but now i would like to create groups for the active directory and add users to the groups ,is it possible,if yes please help me out .i am using visual studio 2010 web application C#.

Unable to see Active Directory Groups in the User Profile Database after Profile Import

  
SharePoint Server 2010 Enterprise RTM. W2K8R2 w/multi-server setup: AD/DNS SQL 2008 WFE APP Claims Mode Web App only using Windows Integrated Auth So, this was never a problem in 2007, and I didn't even realize it was a problem in 2010 until I started to build a solution that utilized my blog article: InfoPath - User Roles in Browser-Enabled Forms Using AD Groups.  I went to utilize the same web method of the same web service, but I noticed that no data was showing up at all.  Typically, the GetUserMembership/GetCommonMembership methods return the specified user's memberships: AD Security Groups, AD Distribution Lists, and SharePoint Sites (not SharePoint Groups, though). My user profile sync is working.  All AD users are pulled in with the proper profile data. "Users and Groups" is selected in the Synchronization Entities section of my Sync Settings. Security groups are working for permissions and audience targeting.  Confirmed my users are affected properly by the use of Security Groups. My query to the GetUserMemberships web method (and GetCommonMemberships) is running (not failing), but it's not returning anything even though my user is in some Security Groups and has explicit membership to multiple sites. The GetUserProfileByName method of the same UserProfileService.asmx web service returns all the regular profile data

working with Active Directory groups

  

Hi

I don't know much about active directory groups and programming with AD.  Now I am working on a project which will have 5 to 6 links to otherweb pages and I want to give access to these pages based on the logged in users.

So I am implementing a administration project to give access to these web pages and planned to keep all the application names in one table and all the users in another table. When ever a person or group needs access to a single project, I want to add them through another screen linking users to applications and store it in a table. When user tries opening the web page in the project then it needs to verify the logged in user in the table and display the project if it has a entry for the user with the application.

I am planning to implement some thing like below

Applications Table

ApplicationID

ApplicationName

 

Users Table

UserID

LoginUserName

ADGroup

 

Link Application to User

UserID

ApplicationID

 

When user logs in verify the above table to check if user with the application is available and display the web page required.

 

To do this I need to store all the employees details in the company from different AD groups into the users

people picker need to customize source of active directory users

  

Issue- setting the people picker to custom active directory OU

Scenario - The ad structure

Domain.com

     Company name(root)

      Department(OU)

                 General Users(OU)

                  Staff(OU)

Steps Taken

1)stsadm -o setsiteuseraccountdirectorypath -path "OU=STAFF,DC=domain,DC=com" -url http://domain.com

2)stsadm -o setproperty -url http://domain.com -pn peoplepicker-serviceaccountdirectorypaths -pv " OU=STAFF,DC=domain,DC=com "

 They  dont seem to have any effect on the people picker control as i can still get  all the users from all the different OUs.

I want to strict  it to the Staff OU.

IT seems really strange

In the Central admin > shared Services Providers> User Profile> Custom Source > I have set OU=STAFF,DC=domain, dc=com.

I found that the people picker is not connected to the user profiles.

:)

Any Idea Guys


SSIS SharePoint List Adapter - how to query Users & Groups?

  

I am using SSIS SharePoint List Adapter to load data in and out of my SharePoint Lists from within SSIS, and most of it is working fine.  However, I need to perform a lookup against the Users & Groups collection in SharePoint so I can retrieve the UserID and set the value when writing back to SharePoint.  Any help would be tremendously appreciated!

Thanks.


Editing List that is populated by Active Directory

  

Hi,

I'm doing some work for a customer that has a Telephone Directory list on his Sharepoint intranet home page. The list is populated from the "Users & Groups" in sharepoint, but they can edit the entries to change things like extension numbers, etc within the list.

Recently, they have reported that they are unable to edit the entries. I have VPN'd onto their site and, indeed, they can't.

Having not designed their system myself, I can't confirm how the list was set up, so... here is my big ask:

1) How would this have most likley been set up?

2) What is the most likley cause for their newly-found restrictions?

They guy claims that he hasn't changed anything lately, but... well, we all know customers, right?

Sorry to be so vague about this. If I learn any more detail, I will post here.

Cheers,
AJ


Update Active Directory attributes - Security Answer and Password - Console Application

  


Hi,

I need to update active directory properties(attributes) through console application like Title,mail,sn,passwordQuestion,passwordAnswer.

DirectoryEntry.Properties["passwordQuestion"].Value = "What is your Favorite Color?";
DirectoryEntry.Properties["passwordAnswer"].Value = "green";

after updating , i check the attributes in Active Directory. All its fine.

the "password answer" saved as plan text.

After logged into asp.net portal with user's credential, it is working fine. After logout, When i goto click forgot password link, it ask the email address after that display the security password question and need to be enter the security password answer.

when i enter the security password answer in the text box , after click submit, it throw the error.

Invalid length for a Base-64 char array. Exception Stack Trace: at System.Convert.FromBase64String(String s) at System.Web.Security.ActiveDirectoryMembershipProvider.Decrypt(String encryptedString) at System.Web.Security.ActiveDirectoryMembershipProvider.ResetPassword(String username, String passwordAnswer) at System.Web.Security.MembershipUser.ResetPassword(String passwordAnswer) at

 

But i update the passwordQuestion,passwordAnswer through web application(portal)

Copy and Maintain Active Directory User details into mysql table using C#

  

For a given Domain name how can I retrieve the AD User details including a Unique identifier so that any changes to the user details including the username can be updated using the unique Identifier.

I can use System.DirectoryServices.DirectoryEntry to get the user details but not able to figure out how to work with the Unique Identifier to maintain the user details consistently.

Please provide me with some sample.

Thank you


Building Groups in Active Directory versus Using SharePoint Groups

  

Hi,

Can someone point me to an article or blog that discusses the pros and cons of setting groups (owner, full control, contributor, read only) in the Active Directory verus just connecting MOSS 2007 to the AD and building the groups directly in MOSS?  MOSS 2007 only.  Is there any functionality that is lost by building the groups in AD and adding people there rather than building groups in MOSS and adding people there?

Thanks!


Thanks! Patti N.

Populate Drop-Down list box from Active Directory Data Connection?

  
Hi,

I recently created a data connection to my active directory, so that certain fields can be automatically populated given the user who is filling in the form.

However, I would like to have a drop-down box that is populated from Active Directory (i.e. the user of the form can select another AD member), the result of which will then populate other fields (with information such as Manager, Email Address, etc).

So, 2 questions:

  1. How do I get a drop-down list to populate with the members of AD?
  2. How do I get the result of this selection to populate other fields?
Cheers again - you guys are great!

Get list of users who have active or LIVE my sites

  
Is there a way we can get a list of users who have activated their My sites. OR at least a list of all the My Sites created by the users.

Problem With space When updating password of active directory users from asp.net

  

Hello Friend's


From long time i am facing problem with Reseting password of users of active directory from asp.net.


The coding is work fine when there are no space in username but it's cause a problem when there are space in username.


                      

usernametochange = "Ketan Patel";
                       ds.Filter = "(&(objectClass=user)(sAMAccountName=(" + usernametochange + ")))";
                       ds.PageSize = 100;

                       SearchResult account = ds.FindOne();
                       DirectoryEntry user = account.GetDirectoryEntry();
                       object[] oPassword = new object[] { "krtya#123" };

                       try
                       {
                           object ret = user.Invoke("SetPassword", oPassword);
                       }


if you have any idea about it please help me.


Thank you.....


Active Directory - List group managed by a specific user

  

Hello every body,

I need to know how I can find which groups of an active directory are managed by a specific user. The idea is to create a WinForm appication where the user enter a name and then, the code chek whicjh group of the AD is managed by the name entered.

Has someone any idea? I jusrt need specification about the Active Directory classes and methods...

Thanks ;-)


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend