Hello Swamy,
| Quote: |  | |
|
> Hi,
>
> without specifying the complete DN of an object and using
> [ADSI]"LDAP:// "
> provider can i serach an object? assuming my AD has many OU and users
> are
> spread across many OU?
| |
| | |
$username = "swamy"
$searcher = new-object DirectoryServices.DirectorySearcher([ADSI]"")
$searcher.filter = "(&(objectClass=user)(sAMAccountName= $UserName))"
$searcher.findall()