- Outlook private groups vs aliases how to#
- Outlook private groups vs aliases code#
- Outlook private groups vs aliases download#
Don’t forget to test first with the -WhatIf parameter, as shown in the article.ĭid you enjoy this article? You may also like Configure Azure AD Multi-Factor Authentication. The script output will show which alias addresses are removed. Add the domain that you like to remove and run the script.
Outlook private groups vs aliases download#
Download the Remove-Alias-M365-Group.ps1 PowerShell script.
Outlook private groups vs aliases how to#
Also, we showed how to bulk remove alias addresses from Microsoft 365 Groups to speed it up. In this article, you learned how to remove alias address from Microsoft 365 Group with PowerShell. Read more: Remove users from group with PowerShell » Conclusion I hope that this helped you to remove unwanted aliases from Microsoft 365 Groups. The alias addresses are removed in bulk from Microsoft 365 Groups. Remove the -WhatIf parameter from the PowerShell script and rerun the script. In our example, the script will bulk remove all the alias addresses with the domain After running the script, confirm that these are the alias addresses that need to be removed. You will get an output showing what will happen. If you run the script, nothing will happen in the environment. Good to know is that the -WhatIf parameter is added in the script. The script will go through all the Unified Groups in the environment. Run remove alias from Microsoft 365 Group PowerShell scriptĬhange directory to the script path and run the Remove-Alias-M365-Group.ps1 script. In the next step, you are going to run the script and see it in action. Write-Host "Removing $_ from $Group" -ForegroundColor Green $Group.EmailAddresses | Where-Object -WhatIf # Change to the domain that you want to remove
$Groups = Get-UnifiedGroup -ResultSize Unlimited
Create a script folder if you don’t have one. Give it the name Remove-Alias-M365-Group.ps1 and place it in the C:\scripts folder.
Outlook private groups vs aliases code#
Bulk remove alias from Microsoft 365 Group Prepare remove alias from Microsoft 365 Group PowerShell scriptĭownload Remove-Alias-M365-Group.ps1 script or copy and paste the below code in Notepad.
What if you want to remove aliases from all Microsoft 365 Groups? Or a specific domain from all Microsoft 365 groups? Let’s have a look at that in the next step. PS C:\> Get-UnifiedGroup -Identity | Select-Object -ExpandProperty EmailAddresses | looks great! Verify that alias address is successfully removed. PS C:\> Set-UnifiedGroup -Identity -EmailAddresses Verify Microsoft 365 Group alias removal In this example, we will remove the address. Remove alias with the Set-UnifiedGroup cmdlet and EmailAddresses parameter. PS C:\> Get-UnifiedGroup -Identity | Select-Object -ExpandProperty EmailAddresses | Remove Microsoft 365 Group alias
Group1 Get Microsoft 365 group email addressesĮxpand the email addresses for the Microsoft 365 Group. PS C:\> Get-UnifiedGroup -ResultSize Unlimited | Select-Object DisplayName,PrimarySmtpAddress | Sort-Object DisplayName Run Get-UnifiedGroup cmdlet and list Microsoft 365 Groups. PS C:\> Connect-ExchangeOnline Remove alias from Microsoft 365 Group Get Microsoft 365 group Remember that you need to connect to Exchange Online PowerShell V2 before running the cmdlets and Remove-Alias-M365-Group.ps1 PowerShell script.