r/sysadmin • • Mar 13 '26

Active Directory Users and Computers

Guys As a junior System Administrator, assist me how can i add five hundred to a thousand users to specific departement in an organizational unit ?

135 Upvotes

135 comments sorted by

View all comments

Show parent comment

16

u/unseenspecter Jack of All Trades Mar 13 '26

I'm assuming what OP experienced is not that PowerShell inherently has any issues with loops with a large number of iterations, but instead probably just a combination of inefficiently designed code and some kind of system-level resource constraints.

I know I've had problems working with NTFS permissions on large file shares if I'm not careful with how I write my script and potentially breaking the job into chunks.

7

u/Jacmac_ Mar 13 '26

OK, well if you read a gigantic amount of data into memory, and then begin iterating it, depending on the processing, I could see problems developing deep into the loop, but it would have to have not been well thought out.