Solved

Excel: Assign names to a group (Distribution List)

Posted on 2013-06-24
2
425 Views
Last Modified: 2013-06-25
Hello All-
I'm stumped with this one.  Environment:
AD 2008R2, Exchange 2010.
I received a list of almost 600 distribution lists from my client. Unfortunately, it was just the names and did not include membership. I used Powershell to create the DLs but now I need to populate them. I have a script that will work, but I'm stumped on how to parse the data and assign users to a DL.
If you take a look at my attachment (capture.jpg), you'll see the DL alias as the first column and the list of DL members to the right. Each member SAMAccountName is separated by a space.
Ideally, I'd like to take each name and put it on its own row (not column) so I can easily create an import file to use with Powershell. I've created a mock-up of what I'm looking for (see After.jpg)
Can this even be done? Or can anyone advise me on a better approach?
Thanks!!
EricData as I received itafter.JPG
0
Comment
Question by:Cymbaline65
  • 2
2 Comments
 

Author Comment

by:Cymbaline65
ID: 39272718
After giving this some thought, it could be better said that instead of doing "text to columns", I want to do "text to rows." I found a VB Script on the web but it does not work - or at least I could not get it working.
0
 

Accepted Solution

by:
Cymbaline65 earned 0 total points
ID: 39275297
Ended up using powershell, no Excel trickery required:

Import-CSV c:\List.csv | foreach { $dgName = $_.name; Get-DistributionGroup -Name $dgName; $_.members.split(" ") | foreach { Add-DistributionGroupMember -id $dgName -member $_}}
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This video discusses moving either the default database or any database to a new volume.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question