List

Needless to say, creative naming of Groups and Team sites is a never-ending story. This guide, however, let you retrofit the name of those badly named groups.

Now, in order to perform these actions, there are some prerequisites where AzureADPreview and Teams (if you are to retrofit a Teams group) for PowerShell. These packages are installed with the following commands:

Install-Module -Name AzureADPreview
Install-Module -Name MicrosoftTeams

Connecting and retrofritting

In order to identify the groups that you desire to rename, you could type in the groups name, or E-mail. I prefer the latter for better control.
$UNIQ = Read-Host "Please type the group name/E-mail that you desire to change"

The following code will prompt you as a tenant admin to type in the new name for the group, and the domain for your alias

$NewName = Read-Host "Please type the desired name of the group"
$DomainName = Read-Host "Please type your domain, eg. solaat.no"

In order to clean up clutter (removal of invalid characters in the groups new E-mail), the following command create the new mail alias.

$NM = $NewPrefix + ($NewName -replace " ","" -replace '[^a-zA-Z0-9]', '')

In order to retrofit the group, the code below needs to be altered in line 2 for personalization of the note. The two last lines provides a visual outcome of the change that will happen.

$OldGroupDN = (Get-UnifiedGroup -Identity $UNIQ).DisplayName
$NewNote = (Get-UnifiedGroup -Identity "$UNIQ").Notes + "`n`n - New name by solaat.no"
$NewMail = ("smtp:" + $NM + $DomainName)
$MailPool = (Get-UnifiedGroup -Identity $UNIQ).EmailAddresses + $NewMail
Write-Host "`t" $OldGroupDN "updated to" $NewName
Write-Host "`t" (Get-UnifiedGroup -Identity $UNIQ).EmailAddresses + "updated to" $NewMail

The changes will be committed to the tenant by executing the following commandline;
Set-UnifiedGroup -Identity $OldGroupDN -Alias $NM -DisplayName $NewName -Notes $NewNote -PrimarySmtpAddress ($NM + $DomainName)

Changes done to your group/teams should now be visible in your tenant – or by running the following command;
(Get-UnifiedGroup -Identity $NewName).EmailAddresses

As you may notice, the old E-mail alias is kept, while the new is set as primary SMTP, this ensures that any data or shared notes are still accessible from the old sharing and no new URLs are needed. Hence the outcome in PowerShell should look something like this;

Retrofitting

  • Alex

Leave a Reply

  Posts

1 2 3 4 5
February 1st, 2016

Microsoft Surface Deployment Accelerator now supporting Windows 10

A new version of Microsoft Surface Deployment Accelerator is now released from Microsoft. Version 1.9 now supports Window 10

January 1st, 2016

Congratulations 2016 Microsoft MVP!

Congratulations, you’re an Windows and Devices for IT MVP

November 30th, 2015

Interview: Ben Armstrong

What is distributed software engeneering, and what makes them work?
Of course, one may argue that the right toolset – witch is the mind – is all you need to get a good product. But don’t forget the leader!

October 18th, 2015

Speaking at TechDays Stockholm – Microsoft Surface is Commitment, Excellence, Intelligence and Focus

TechDays is a must-attend-to for every ITpro who works with Microsoft’s products, platforms and solutions. The theme of TechDays 2015 is […]

March 26th, 2015

New firmware for Surface – Disable components in UEFI

It’s not often I write about newly released firmwares for the Surface platforms, However, todays release is somewhat special.

February 24th, 2015

Watch our session: Optimizing Surface deployment and connected standby

Did you miss Olav and my session at NIC earlier in february?
Don’t be sad, now you can catch up on your Surface skills

February 13th, 2015

Brush up your Surface skills with MVA

Are you and your company investing in Surface Pro 3? This is your online training session. All for free!

February 12th, 2015

NIC 2015 winners

Are you feeling lucky?

February 12th, 2015

How-to: Fix PowerShell window on Surface

Have you ever tried to open PowerShell on a high-resolution, small-screen device? This is how you make the font readable.

February 12th, 2015

Power your Surface with LTE broadband

As Surface MVP I often get these question related to mobile broadband. My reply is something you oughta know!