Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AD: Domain Users vs. Users

Status
Not open for further replies.

JimmyFo

Programmer
Feb 14, 2005
102
US
Hi, I am querying a test AD that I set up today, that is its own forest and DNS - the name is OPENTEST.EXAMPLE. I created a user called "jfogarty" on it, so the logon is "OPENTEST\jfogarty". This user is part of the "Domain Users" group, but not "Users".

I am trying to use VB to see if that user is there, but no matter what, it doesn't show up - for example, I can find the ASPNET or Adminstrator user, but I cannot find anything whose CN or UID has my login.

I check by result.Count()

For example, working:

Code:
deSearch.Filter = 

"(&(|(objectClass=User)(objectClass=Domain User))(cn=Administrator))" 

Dim results As SearchResultCollection = deSearch.FindAll() 

'deSearch.Filter = "(&(objectClass=User)(cn=Adminstrator))" 'WORKING 

'deSearch.Filter = "(&(objectClass=User)(sn=Fogart*))" 'WORKING
For example, non-working:

Code:
deSearch.Filter = "(&(|(objectClass=User)(objectClass=Domain User))(uid=jfog))"


Dim results As SearchResultCollection = deSearch.FindAll() 
deSearch.Filter = "(&(|(objectClass=User)(objectClass=Domain User))(cn=OPENTEST\*))"


Dim results As SearchResultCollection = deSearch.FindAll() 
deSearch.Filter = "(&(|(objectClass=User)(objectClass=Domain User))(cn=*jfog*))"


Dim results As SearchResultCollection = deSearch.FindAll()
What am I doing wrong?

Thanks!

James
 
To clarify, this is how I am accessing the LDAP:

Code:
Dim de As DirectoryEntry = New DirectoryEntry("LDAP://#.#.#.#", "OPENTEST\Administrator", "password", AuthenticationTypes.Secure)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top