Solved

Excel: Assign names to a group (Distribution List)

Posted on 2013-06-24
2
390 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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Merging multiple rows to one 22 33
Exchange 2016 anti-spam 3 33
Convert .PDF 6 38
Exchange 2010 to 2016 migration 1 18
Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

744 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

18 Experts available now in Live!

Get 1:1 Help Now