Solved

Excel: Assign names to a group (Distribution List)

Posted on 2013-06-24
2
404 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

The curse of the end user strikes again      

You’ve updated all your end user’s email signatures. Hooray! But guess what? They’re playing around with the HTML, adding stupid taglines and ruining the imagery. Find out how you can save your signatures from end users today.

Question has a verified solution.

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

This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
Read this checklist to learn more about the 15 things you should never include in an email signature.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

864 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now