Author:
Date: May 26, 2008 07:38
Hi,
I have just started this new position and am building a web based application to add users to the active directory. The code I am using to add an account is:
Dim dirEnt As DirectoryEntry = GetDirectoryEntry(Container, ownrName, pass)
Dim users As DirectoryEntries = dirEnt.Children
Dim newuser As DirectoryEntry = users.Add("CN=" & FirstName & " " & LastName, "user")
This works perfectly fine for me and the account gets added. However when I am doing a search for all users, the filter
ds.Filter = "(&(objectCategory=Person)(objectClass=user))"
doesn't return the newly added user. I have tried varying the filter but am unable to find the user, although if I query for just the user account I am able to find it. I believe that the objectCategory on the account is not being set to "Person" but have been able to find no information on how to alter these settings.
Any help would be deeply appreciated.
Geoff
|