Hi,
We have a Domain with about 150K User accounts. Our goal is to produce a list of candidate users which we will then modify attributes on. Based on the filter used on a Get-Aduser, we may have 50K user accounts we may need to process and set/replace attributes on. However, we only want to set/replace the attributes on say 10K at one time in order to minimize impact.
I've looked at ResultSetSize, but that only helps determine how many objects to return in my query. We want to return the entire candidate list of users, then process in defined increments in the future.
Right now, my Get-Aduser looks like the following, then the variable with all the objects gets processed by a Set-Aduser where I set/replace the attributes. So how do I save all of my $AllCandidateUsers objects, then process them in defined increments in the future? So I'd like to process the first 10k, then have some way to pick up at object 10,001 and process to 20,000 at a later time, then pick up at object 20,001 and process to 30,000 at a later time, etc. I'm hoping this can be done programmatically without me keeping track of the objects manually.
$AllCandidateUsers = Get-ADuser -Filter .......