Forum Discussion
Is there a way to change O365 group email address using powershell
- Oct 12, 2017If you want to update the Email Address of the Office 365 group, please follow below steps.
O365 Group Name :- Test O365Group
Current Email addres :- test.o365@abcd.onmicrosoft.com
Update to :- test.o365@abcd.com
Follow below script in powershell.
Set-UnifiedGroup -Identity "Test O365Group" -EmailAddresses: @{add="SMTP:test.o365@abcd.com"}
O365 Group Name :- Test O365Group
Current Email addres :- test.o365@abcd.onmicrosoft.com
Update to :- test.o365@abcd.com
Follow below script in powershell.
Set-UnifiedGroup -Identity "Test O365Group" -EmailAddresses: @{add="SMTP:test.o365@abcd.com"}
"
Yahkoob Ayappally wrote:
If you want to update the Email Address of the Office 365 group, please follow below steps.
O365 Group Name :- Test O365Group
Current Email addres :- test.o365@abcd.onmicrosoft.com
Update to :- test.o365@abcd.com
Follow below script in powershell.
@Set-UnifiedGroup -Identity "Test O365Group" -EmailAddresses: @{add="SMTP:test.o365@abcd.com"}
If I use that command, I get the following error:
There are multiple primary SMTP addresses. Please ensure there is only one primary address for each address type."
- John GregorySep 11, 2018Copper ContributorOld thread but I had this issue and couldn't see the answer here.
The solution is: you need to use lowercase "smtp" rather than "SMTP".
Uppercase "SMTP" indicates the primary email address. - Yahkoob AyappallyOct 19, 2017Brass Contributor
Hi John,
Steps to change Office 365 group Email address:-
Current SMTP address :- test.o365group@abcd.onmicrosoft.com
Required SMTP address :- test.o365group@abcd.com
Follow the below steps in power shell using Global Administrator Credentials,
1. Connect to Exchange Online via Power shell using Global Administrator Credentials and run the below commends. First two command run separately.
Set-ExecutionPolicy Unrestricted
Start-service winrm
Import-module MSOnline
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
Connect-MsolService -Credential $UserCredential2. Run the below command to add required SMTP address as an alias.
Set-UnifiedGroup -Identity "X" -EmailAddresses: @{Add ="Y"}
here X is the Display Name of Office 365 group and Y is the required Email ID.
Set-UnifiedGroup -Identity "Test o365Group" -EmailAddresses: @{Add ="test.o365group@abcd.com"}
3. Promote alias as a primary SMTP address,
Set-UnifiedGroup -Identity "Test O365Group" -PrimarySmtpAddress "test.o365group@abcd.com"
4. If not required, you can remove first ID using below command.
Set-UnifiedGroup -Identity "Test o365Group" -EmailAddresses: @{Remove="test.o365group@abcd.onmicrosoft.com"}
Please note, For updating the Office 365 group SMTP address required Global Administrator access.
Thanks and Regards,
Yahkoob Ayappally
- Luuka_AlexanderFeb 03, 2020Copper Contributor
Yahkoob Ayappally Worked like a charm 🙂 Nice, easy and simple to follow. Thank you.
- Likun ChenJul 19, 2019Copper Contributor
Yahkoob Ayappally Thank you.
To all others, notice this method won't change the URL of group's SharePoint site.
There seems to be a pilot program to let you rename sp site's url. The latest sp shell cmdlet also includes `Start-SPOSiteRename` command. But for now, we are still at the mercy of MicroSoft to make it available.
https://office365itpros.com/2019/05/02/sharepoint-online-rename-site-names/
- pnthrzruleJan 02, 2020Iron Contributor
Generally speaking, site URL can now be edited via the SP Admin Center
- nattusrattusJan 31, 2019Copper Contributor
Thanks this worked perfectly. I did have to wait a couple of minutes between commands though for them to be fully actioned on o365, running them immediately gave errors.