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"}
works like a charm so Thx, one thing it doesn't seem to do I want to change from Capitals to lowercase
WORD@mail.com to word@mail.com
any advice/suggestions?
Thanks for your update!!!
I think you don't worry about the capital and small letters, its case sensitive and you can ignore it. I hope you can change the capital to small letters because mail system is considered as a both are same email address. You can spread your group email ID as usual with word@mail.com and you will receive all emails.
Let me know if you have a more query.
Regards,
Yahkoob A
- Nayan_PApr 21, 2021Copper ContributorTankyou so much for posting Yahkoob Ayappally, be blessed
- Lucky PanditAug 30, 2018Copper Contributor
Thanks Yahkoob!
All your steps worked for except the last one to remove the email address. For some reason I am not able to remove the old email address associated with the group. I have attached the command I am using and message that I am getting.
PS C:\WINDOWS\system32> Set-UnifiedGroup -Identity "xxxxxx - Technical" -EmailAddresses: @{Remove="xx@xxx.onmicrosoft.com"}
WARNING: The command completed successfully but no settings of 'xxx_23d3be76e5' have been modified.Thanks for your help.
- Iosif MatiesJul 24, 2018Copper ContributorHi Luciano,
Take this script https://gallery.technet.microsoft.com/office/Bulk-Add-SMTP-Addresses-to-e3d28842
Change the $Mailboxes line from @(Get-Mailbox ...) to @(Get-UnifiedGroup...)
Also change at the end to Set-UnifiedGroup -Identity $Mailbox.Alias ...
Then run it like .\Add-SMTPAddresses.ps1 -Domain whatever.com -MakePrimary -Commit
Tested today and it works. Enjoy! ^_^ - DeletedJun 20, 2018
Hi Yahkoob,
I asked last year something like that and you answer me but what I really need is to change all O365-Groups which are have been created in the past (not my past) with the wrong email addresses something like this @abc.onmicrosoft.com, how could be posible to use your script but for all O365 and not only one or two. Thank you so much.
Best regards,
Luciano
- DeletedJun 20, 2018
Worked like a charm, Sweet
Thx ever so much!
- Yahkoob AyappallyJun 20, 2018Copper ContributorHi Susan,
Yes It is possible, you can add new email ID and you can promote your new Email ID as an SMTP and you can remove your Old Email ID. But performing this steps, you need a global Administrator access.
Please follow below Steps to change Office 365 group Email address:-
Current SMTP address :- WORD@mail.com
Required SMTP address :- word@mail.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 $UserCredential
2. 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.
Eg:- Set-UnifiedGroup -Identity "Test o365Group" -EmailAddresses: @{Add ="WORD1@mail.com"}
3. Promote alias as a primary SMTP address,
Set-UnifiedGroup -Identity "Test O365Group" -PrimarySmtpAddress "WORD1@mail.com"
4. Remove first ID using below command.
Set-UnifiedGroup -Identity "Test o365Group" -EmailAddresses: @{Remove="WORD@mail.com"}
5. Again Add required Email Address
Eg:- Set-UnifiedGroup -Identity "Test o365Group" -EmailAddresses: @{Add ="word@mail.com"}
6. Promote alias as a primary SMTP address,
Set-UnifiedGroup -Identity "Test O365Group" -PrimarySmtpAddress "word@mail.com"
7. Remove first ID using below command.
Set-UnifiedGroup -Identity "Test o365Group" -EmailAddresses: @{Remove="WORD1@mail.com"}
Please note, For updating the Office 365 group SMTP address required Global Administrator access.Hope this will help you and let me know if you are facing any issue on this.
Thanks and Regards,
Yahkoob Ayappally - DeletedJun 20, 2018
Hi Yahkoob
Thanks for this. And I figured this is why it doesn't change. However we would like it to display in lowercase as it's our company name and it's officially spelled lowercase. If you have a solution great. If not we have to live with it, like with many other "imperfections" :-)