Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

result size AD QUery

93 views
Skip to first unread message

roberto...@gmail.com

unread,
Jul 16, 2012, 9:42:32 AM7/16/12
to
Hi ,

I have ran this part of script

ObjFiler = "(objectCategory=User)"
$objSearch = New-Object System.DirectoryServices.DirectorySearcher
$objSearch.SearchRoot = "LDAP://ou=studenti,dc=studenti,dc=local"
$ObjSearch.SizeLimit = 100000
$ObjProp = "userprincipalname"
$objSearch.Filter = $ObjFiler
$AllObj = $objSearch.FindAll()

At the end of execution the numer of object of $AllObj is always 1000.
Why? Have you some ideas?

Thanks
Rob.

rudy.sc...@gmail.com

unread,
Jul 16, 2012, 2:36:55 PM7/16/12
to
Hi Rob,

as long as you don't specify the PageSize, the directorySearcher will not enable paging which is required to retireve more than the default 1000 objects (or 1500, depending the OS you're on).

Add the following to your script:

$ObjSearch.PageSize = 1000

HTH,

Rudy

Op maandag 16 juli 2012 15:42:32 UTC+2 schreef Rob.Pasky het volgende:
> Hi ,
>
> I have ran this part of script
>
> ObjFiler = "(objectCategory=User)"
> $objSearch = New-Object System.DirectoryServices.DirectorySearcher
> $objSearch.SearchRoot = "LDAP://ou=studenti,dc=studenti,dc=local"
> $ObjSearch.SizeLimit = 100000
> $ObjProp = "userprincipalname"
0 new messages