-resultsize unlimited

Ask your Windows PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
matrix101
Posts: 7
Joined: Thu Jun 07, 2007 4:29 am

-resultsize unlimited

Post by matrix101 » Mon Jun 21, 2010 12:01 pm

hi all,

I have this script I got on the internet and need to make it so it's not limiting me to 1000 objects.

I know I have to use the "-resultsize unlimited" but I don't know where to put it, I tried various places and it just errors out on me. Without it the search is limited to 1000.

I'm doing my best to learn powershell and been online but can't find anything specific.

here is the code***can you please let me know where to plug in the "-resultsize unlimited" Thank you.

$OU = 'LDAP://OU=Users,OU=Managed Objects,dc=corp,dc=jitb,dc=net'$Root = New-Object DirectoryServices.DirectoryEntry $OU
#create a selector and start searching from the root of AD$selector = New-Object DirectoryServices.DirectorySearcher$selector.searchRoot = $root$adobj=$selector.findall()"There are $($adobj.count) objects in the $($root.name) OU"



Thanks.

User avatar
matrix101
Posts: 7
Joined: Thu Jun 07, 2007 4:29 am

-resultsize unlimited

Post by matrix101 » Mon Jun 21, 2010 12:01 pm

hi all,

I have this script I got on the internet and need to make it so it's not limiting me to 1000 objects.

I know I have to use the "-resultsize unlimited" but I don't know where to put it, I tried various places and it just errors out on me. Without it the search is limited to 1000.

I'm doing my best to learn powershell and been online but can't find anything specific.

here is the code***can you please let me know where to plug in the "-resultsize unlimited" Thank you.

$OU = 'LDAP://OU=Users,OU=Managed Objects,dc=corp,dc=jitb,dc=net'$Root = New-Object DirectoryServices.DirectoryEntry $OU
#create a selector and start searching from the root of AD$selector = New-Object DirectoryServices.DirectorySearcher$selector.searchRoot = $root$adobj=$selector.findall()"There are $($adobj.count) objects in the $($root.name) OU"



Thanks.

Locked