Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Managing Distribution Group via Powershell Script

$
0
0

I have a request to automate management of a Distribution list. The idea is that corporate will send my organizational unit a CSV file monthly and all users listed in that file must be members of a specific Exchange Distribution group.

If the user account does not exist I need the script to create it. If the user is not in the CSV file it needs to be removed from the Distribution list but does not need to delete the account.

What I'd like the final procedure to look like is as follows:

The first time we receive the csv file I run the script and it adds the users listed into the appropriate distribution group. I suspect about 20% of the accounts won't exist so the script parses the user name information into our standard and creates them into a specified OU and adds those new accounts into the Distribution group during creation. Then every month we re-run the script with the latest csv. It verifies that all users listed in the csv are members of the specified group. If a user is dropped from the csv then the script will remove that user account from the distribution group.

The test csv I received has three columns, a company ID number, the User's Name in this format (LastName,Firstname MI), and their company email address which is FirstName.LastName@domain.com.

I am not the greatest with scripting so I'm hoping someone can either help me create one or possibly has a script similar to this that I could modify as needed.


Vincent Sprague


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>