Finding a user in any OU

Finding a user in any OU

Post by Marc » Fri, 03 Nov 2000 02:34:22



I can easily locate a user with the GetObject command if I know exactly
which OU or Container a user is located in.  My question is how do I locate
the user with the GetObject command if I don't know which OU that account
may be located in?

This line works if I know that Joe User's account is in the Somewhere OU.
set adUser = GetObject("LDAP://CN=Joe User,OU=Somewhere,DC=company,DC=com")

but if Joe User isn't in the Somewhere OU, and I don't know which OU, how
can I bind to the account?  Surely there's a way to search the domain, and
either find which OU the account is in, or even find the account?

Any help would be greatly appreciated.

--Marc

 
 
 

Finding a user in any OU

Post by Egbert Niero » Fri, 03 Nov 2000 23:45:22


use the MSDN.
http://msdn.microsoft.com/library/default.asp?URL=/library/backgrnd/h...
dsi.htm


Quote:> I can easily locate a user with the GetObject command if I know exactly
> which OU or Container a user is located in.  My question is how do I
locate
> the user with the GetObject command if I don't know which OU that account
> may be located in?

> This line works if I know that Joe User's account is in the Somewhere OU.
> set adUser = GetObject("LDAP://CN=Joe

User,OU=Somewhere,DC=company,DC=com")
Quote:

> but if Joe User isn't in the Somewhere OU, and I don't know which OU, how
> can I bind to the account?  Surely there's a way to search the domain, and
> either find which OU the account is in, or even find the account?

> Any help would be greatly appreciated.

> --Marc


 
 
 

Finding a user in any OU

Post by marv » Sat, 04 Nov 2000 07:09:16


I guess you could use the samAccountName, if you know that of course....