Objects limits 1000 in AD

by Mar 4, 2015

Hi all

I have about 1500 objects. So when i run get-mailbox -resultsize unlimited it fails at 1000.

I have found below on the internet, but not sure if this would fix my problem and if it does what are the commands to set it in powershell, if not what can i do

Any help would be great

set the DirectorySearcher.SizeLimit
property to some value you need – this will return that given number of
entries in a single search; however, you cannot get more than the
server limit (default: 1'000 entries) back in a single operation –
however, that server limitation is a configurable option – you could set
it higher, and then set your directory searcher's size limit higher –
but the more entries you want to return at once, the longer your call
will take!

set the DirectorySearcher.PageSize
to some value, e.g. 250 or so, to do "paged searches", e.g. you get
back 250 entries in a single operation, and if you iterate to the 251st
entry, the directory searcher goes back (in a second, third, fourth
call) to get another 250 entries. This is typically the better option
since you get back that number of entries quickly, but you can keep
searching for more entries as needed