How to use PowerShell to Change the Email Address of Office 365 Groups
One of the odd things about Office 365 is how much you have to resort to PowerShell to get things done. That's currently the case with the Office365 Groups, a recently introduced type of group that works particularly well across all of the Office365 applications.
In both cases, I was able to change the name but the email address itself was greyed out.
The Solution is to use PowerShellStart Powershell by clicking Start and typing PowerShell, then Right-click on the icon and run as Administrator.
In the console that appears, type;
This elevates some privileges. You'll need to choose Y and press enter.
Next, you'll want to sign into your Office 365 account as an administrator. Type
$UserCredential = Get-Credential
and press enter. You'll be prompted for a user name and password.
Next we need to connect a session to Microsoft Exchange in the cloud.
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
and you'll want to import that session.
Changing the Email AddressThis last command is the one that changes the email address but you'll need to know your group name and the new email address first.
Don't type this, you'll want to change the bold bits.
Set-UnifiedGroup -Identity "GroupName" -PrimarySmtpAddress GroupEmailAddress -RequireSenderAuthenticationEnabled $false
So, in our case, we want to change InformationTechnology1@mycompany.com.au to InformationTechnology@mycompany.com.au. The group name is Information Technology. This means that the command to use would be;
Set-UnifiedGroup -Identity "Information Technology" -PrimarySmtpAddress email@example.com -RequireSenderAuthenticationEnabled $false
That's it. If you switch back to the admin screen and refresh, you'll see that the group now has the correct email address.
If you want to change more groups, you can simply run that last command line again with different parameters (all the earlier lines were just set up lines). If you've finished, you can simply close PowerShell.