Add a CSV list of users to an AD group with powershell

I love Quest’s powershell cmdlets for AD. They have added a ton of productivity improvement to my life. Since I was used to writing scripts in VB and using dsquery and dsmod, it wasn’t a fast process, but eventually I started to get the hang of the syntax and boolean changes. Here is one quick super easy script that has recently saved me a bunch of time. Keep in mind you have to have the Active Roles Management Shell for AD installed, which is a free plugin released by Quest, otherwise you won’t be able to add the snapin with the first line.

add-PSSnapin quest.activeroles.admanagement -erroraction SilentlyContinue
Get-Content “C:\Powershell\listofusers.csv” | Add-QADGroupMember “Security Group Name”

All that is in that CSV is a list of SAM account names in the first column. Quick and easy.

Advertisements
Posted in Powershell

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Papers
People
Map

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 32 other followers

%d bloggers like this: