Monday, October 20, 2014

Modify DistributionGroup field en masse

Ok so we are in the process of migrating to Office365.. a push started by our parent company.  After the move there will be one giant GAL for all the operating companies.  To help combat the complexity of such a beast I have to pre-pend ALL of my existing DG's with 'UB_"

I found a quick way to accomplish such a task, Enter POWERSHELL! lol.


Ok so first export your DG view from the EMC to a .csv.  You will end up with a spreadsheet with a few columns, delete all but the Name column and Save.

Then from the EMS type:



I had around 154 groups to rename, and caught errors on 4 of them.  MUCH better than a manual process obviously.

Now just to help keep things as simple as possible I wanted both the Name, DisplayName and Aliases to match.  By changing $_.Name after the Set-DistributionGroup to $_.DisplayName, then to $_.Alias I was able to accomplish that.

No comments:

Post a Comment