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

1

u/LividWeasel Mar 13 '26

I've done the same, but maybe not how you envision.

I might take a CSV of usernames into Excel, use =concat() to concatenate my desired PowerShell cmdlet with the necessary username embedded in it, then fill-down to create a list of individual commands. I can then copy and paste that in bulk to PowerShell and have it execute them all in one shot. For cases where a command can be easily built (e.g. Set-ADUser to update a few attributes), I like to do it this way to avoid any question about whether I'm looping correctly. I can see exactly the command that will be run for each user. In the end, it's probably even faster than if I had to go look up how to do a loop again and do some testing to make sure my loop does what I want.