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 3 4 5
July 17th, 2014

Firmware update for the Surface Pro 3

Though the Surface- series normally has one driver and firmware Upgrade per month, the Pro 3 got its second this july

June 30th, 2014

Changes to “Windows update” announced

Microsoft recently announced a update, focusing on protection for customers that further enhances the security of Windows Update / Microsoft Update (WU/MU) Client

June 23rd, 2014

Increased storage for OneDrive users; 15 Gb – free!

Microsoft just announced that their cloud-service OneDrive get increased storage. For the free-riders it means an increase from 7GB to 15GB, while Office 365 subscribers will get 1TB of storage in the cloud.

June 11th, 2014

Firmware update for the Surface (Pro) 2

The first “patch tuesday” in june provided the Surface (Pro) 2 owners with a new firmware. These are the changes and improvements.

May 22nd, 2014

Interview: Jeffrey Snover

To develop an application or an entire system is not just all about bits and bytes. The human centric- view is the outmost important resource to have a successful development team. This is the man, and his story behind what we today know as Windows PowerShell.

May 20th, 2014

Surface Pro 3 launched

The new Surface Pro 3 from Microsoft was launched today, announced as the tablet that can replace your laptop.

February 3rd, 2014

Guide: The missing touch keyboard

Portable and touch devices using Windows 8 features a pop-up on-screen touch keyboard. This is how you add or fix the desktop shortcut

January 1st, 2014

Congratulations 2014 Microsoft MVP!

Congratulations, You’re an Surface ITpro MVP!