I would like to go through a large list of users but process them in batches of about 15. For each of the distinct group of 15, they would get a distinct accountexpirationdate e.g., “Set-ADUser -AccountExpirationDate $StartDate.AddDays($j)” where $j is the certain batch of 15. So, for example, I have 1500 total users and I would like to take each 15 and give them an accountexpirationdate of say March 1, 2020 and then the next batch of 15 and increment the accountexpirationdate by one day ie…, March 2, 2020 and so on.
I can do this by placing a for loop going through all 1500 users and then nesting a bunch of if statements (about 100) that would do the trick. I am looking for a more clever and concise bit of scripting.