Adding users to a distribution list, in bulk

If you've every had to add more then two users to a distribution list in outlook you know just how painful the modal dialogs can be.

Doing it in bulk is easy, if you have the right tools (and assuming you are the owner or co-owner of the group).

  1. PowerShell
  2. PowerShell Commands for Active Directory
  3. a list of users you want to add

In this example, I have my list of users in a text file, but it could come from a DB, feed, or other distribution list.

The "script" is all of two lines long:

> $users = cat users.txt | Get-QADUser
> Get-QADGroup <groupName> |  Add-QADGroupMember  -member $users

How great is that?

 

Published Thursday, December 18, 2008 6:59 PM by Scott Weinstein
Filed under: ,

Comments

# Adding users to a distribution list, in bulk | IT Questions

Pingback from  Adding users to a distribution list, in bulk | IT Questions

Wednesday, March 25, 2009 4:20 PM by Phil Reynolds

# re: Adding users to a distribution list, in bulk

Can you tell me the format of the users.txt file?  Is it just domain id's one per line or something else?

Wednesday, March 25, 2009 5:44 PM by Scott Weinstein

# re: Adding users to a distribution list, in bulk

Phil,

exactly that, one id per line.

Leave a Comment

(required) 
(required) 
(optional)
(required)