You are right There is no findall() and getdirectoryentry() method may be
with V2 it is available.
"Brandon Shell [MVP]" wrote:
| Quote: |  | |
|
> not in v1 without modifying the type extensions.
>
> This will do what your wanting
>
> function Get-MyADUser($user="*"){
> $filter = "(&(objectcategory=user)(sAMAccountName=$user)"
> $ds = new-object
> system.directoryservices.directorysearcher([adsi]"",$filter)
> $ds.pagesize = 1000
> $ds.findall() | %{$_.GetDirectoryEntry()}
> }
>
> "Swamy Channaveera" <SwamyChannaveera@xxxxxx> wrote in
> message news 3315E43-B209-4895-9422-E4381049492D@xxxxxx | 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?
| | | | | > | |
| | |