Change Office 365 Group Email Address using PowerShell

Requirement: Change Office 365 Group Email using PowerShell

How to Change Office 365 Group Email Address?
If you want to change the Email address of a Office 365 group, its not possible through Office 365 admin center!
office 365 group change email address powershell

But we can change Office 365 group Email using PowerShell

Office 365 Group: Change Email Address using PowerShell
Lets change the Email of an Office 365 group: External Vendors Group to "ExternalVendors@TheCrescentTech.com"
#Get Credentials to connect
$Credential = Get-Credential
 
#Create the session
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ `
           -Credential $Credential -Authentication Basic -AllowRedirection
 
#Import the session
Import-PSSession $Session -DisableNameChecking

#office 365 powershell change group email address 
Set-UnifiedGroup -Identity "External Vendors Group" -PrimarySmtpAddress "ExternalVendors@TheCrescentTech.com"

#Remove the session
Remove-PSSession $Session

PowerShell to Add Email Address to Office 365 Group:
Set-UnifiedGroup -Identity "External Vendors Group" -EmailAddresses @{Add="VendorsGroup@TheCrescentTech.com"}

Remove Email Address from Office 365 Group using PowerShell
Set-UnifiedGroup -Identity "External Vendors Group" -EmailAddresses @{Remove="VendorsGroup@TheCrescentTech.com"} 
Change Office 365 Group Email Address using PowerShell Change Office 365 Group Email Address using PowerShell Reviewed by Salaudeen Rajack on May 26, 2018 Rating: 5

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.