Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

get-adobject

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 03-18-2007   #1 (permalink)
Did
Guest


 

get-adobject

hi,
while I use the get-adobject cmdlet to get users I found the answer is
limited to 1000.
How should I avoid this limitation ?

Thanks


My System SpecsSystem Spec
Old 03-18-2007   #2 (permalink)
Marco Shaw
Guest


 

Re: get-adobject

See thread "get-adobject only returns 1000 objects" from March 15th.

"Did" <didi10000@walla.co.il> wrote in message
news:1174205403.295784.103200@n76g2000hsh.googlegroups.com...
> hi,
> while I use the get-adobject cmdlet to get users I found the answer is
> limited to 1000.
> How should I avoid this limitation ?
>
> Thanks
>



My System SpecsSystem Spec
Old 03-18-2007   #3 (permalink)
RichS
Guest


 

RE: get-adobject

Its related to the max page size setting in AD which limits the number of
results returned

see this thread

http://www.microsoft.com/communities...6-a875aebfc67f

--
Richard Siddaway
Please note that all scripts are supplied "as is" and with no warranty
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk


"Did" wrote:

> hi,
> while I use the get-adobject cmdlet to get users I found the answer is
> limited to 1000.
> How should I avoid this limitation ?
>
> Thanks
>
>

My System SpecsSystem Spec
Old 03-19-2007   #4 (permalink)
Rob Campbell
Guest


 

RE: get-adobject

As a workaround, you can increse the pagesize returned by the server using
ntdsutil. Note that the default is to retrun 1000 objects per page, and the
setting is per server. If you have multiple DCs, you probably should either
change them all, or choose one and make sure you specify that server as the
target of the cmdlet.

Hopefully they'll get a parameter added to allow handling multi-page gets.

"Did" wrote:

> hi,
> while I use the get-adobject cmdlet to get users I found the answer is
> limited to 1000.
> How should I avoid this limitation ?
>
> Thanks
>
>

My System SpecsSystem Spec
Old 03-19-2007   #5 (permalink)
Gaurhoth
Guest


 

Re: get-adobject

I would advise caution when changing the pagesize of a production domain
controller. The defaults are in place to prevent Denial of Service like
attacks on the domain controller. MS recommends the use of Paged queries
instead since increasing the PageSize can cause performance issues on your
DC.

While the Get-ADObject doesn't yet support this, you can do the same thing
with [NET] code. Probably worth posting a request on PSCX website to get
this ability added to their cmdlet.

Example of [NET] code that I posted on another thread:

$de = [ADSI]''
$ads = new-object directoryservices.directorysearcher
$ads.searchroot = $de
$ads.filter = "(&(objectcategory=person)(objectclass=user))"
$ads.pagesize = 100
$g = $ads.findall()
$g.count


"Rob Campbell" <RobCampbell@discussions.microsoft.com> wrote in message
news:A658CE33-F489-46F3-BBDE-A4541861B160@microsoft.com...
> As a workaround, you can increse the pagesize returned by the server using
> ntdsutil. Note that the default is to retrun 1000 objects per page, and
> the
> setting is per server. If you have multiple DCs, you probably should
> either
> change them all, or choose one and make sure you specify that server as
> the
> target of the cmdlet.
>
> Hopefully they'll get a parameter added to allow handling multi-page gets.
>
> "Did" wrote:
>
>> hi,
>> while I use the get-adobject cmdlet to get users I found the answer is
>> limited to 1000.
>> How should I avoid this limitation ?
>>
>> Thanks
>>
>>


My System SpecsSystem Spec
Old 03-19-2007   #6 (permalink)
Rob Campbell
Guest


 

Re: get-adobject

I changed it on a DC I was confident would be able to handle the load, and
there are 4 more DCs in that site. I just have to be careful to specify that
one when I use the get-adobject cmdlet on searches that could return more
than 1000 objects.

I've already posted the request for an update, and Keith Hill (thanks,
Keith!) has opened a work item to get it included in the next release.

"Gaurhoth" wrote:

> I would advise caution when changing the pagesize of a production domain
> controller. The defaults are in place to prevent Denial of Service like
> attacks on the domain controller. MS recommends the use of Paged queries
> instead since increasing the PageSize can cause performance issues on your
> DC.
>
> While the Get-ADObject doesn't yet support this, you can do the same thing
> with [NET] code. Probably worth posting a request on PSCX website to get
> this ability added to their cmdlet.
>
> Example of [NET] code that I posted on another thread:
>
> $de = [ADSI]''
> $ads = new-object directoryservices.directorysearcher
> $ads.searchroot = $de
> $ads.filter = "(&(objectcategory=person)(objectclass=user))"
> $ads.pagesize = 100
> $g = $ads.findall()
> $g.count
>
>
> "Rob Campbell" <RobCampbell@discussions.microsoft.com> wrote in message
> news:A658CE33-F489-46F3-BBDE-A4541861B160@microsoft.com...
> > As a workaround, you can increse the pagesize returned by the server using
> > ntdsutil. Note that the default is to retrun 1000 objects per page, and
> > the
> > setting is per server. If you have multiple DCs, you probably should
> > either
> > change them all, or choose one and make sure you specify that server as
> > the
> > target of the cmdlet.
> >
> > Hopefully they'll get a parameter added to allow handling multi-page gets.
> >
> > "Did" wrote:
> >
> >> hi,
> >> while I use the get-adobject cmdlet to get users I found the answer is
> >> limited to 1000.
> >> How should I avoid this limitation ?
> >>
> >> Thanks
> >>
> >>

>
>

My System SpecsSystem Spec
Old 03-20-2007   #7 (permalink)
Did
Guest


 

Re: get-adobject

On Mar 19, 2:50 pm, Rob Campbell
<RobCampb...@discussions.microsoft.com> wrote:
> As a workaround, you can increse the pagesize returned by the server using
> ntdsutil. Note that the default is to retrun 1000 objects per page, and the
> setting is per server. If you have multiple DCs, you probably should either
> change them all, or choose one and make sure you specify that server as the
> target of the cmdlet.
>
> Hopefully they'll get a parameter added to allow handling multi-page gets.
>
>
>
> "Did" wrote:
> > hi,
> > while I use theget-adobjectcmdlet to get users I found the answer is
> > limited to 1000.
> > How should I avoid this limitation ?

>
> > Thanks- Hide quoted text -

>
> - Show quoted text -


Hi,
What is the parameter, and where ?

My System SpecsSystem Spec
Old 03-20-2007   #8 (permalink)
Rob Campbell
Guest


 

Re: get-adobject

http://support.microsoft.com/kb/315071

The relevant value is "MaxPageSize".

"Did" wrote:

> On Mar 19, 2:50 pm, Rob Campbell
> <RobCampb...@discussions.microsoft.com> wrote:
> > As a workaround, you can increse the pagesize returned by the server using
> > ntdsutil. Note that the default is to retrun 1000 objects per page, and the
> > setting is per server. If you have multiple DCs, you probably should either
> > change them all, or choose one and make sure you specify that server as the
> > target of the cmdlet.
> >
> > Hopefully they'll get a parameter added to allow handling multi-page gets.
> >
> >
> >
> > "Did" wrote:
> > > hi,
> > > while I use theget-adobjectcmdlet to get users I found the answer is
> > > limited to 1000.
> > > How should I avoid this limitation ?

> >
> > > Thanks- Hide quoted text -

> >
> > - Show quoted text -

>
> Hi,
> What is the parameter, and where ?
>
>

My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
get-adobject only returns 1000 objects Rob Campbell PowerShell 4 03-16-2007 01:31 PM


Update your Vista Drivers Update Your Drivers Now!!

Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008