Set Office 365 Group Privacy to Private or Public using PowerShell

Requirement: Change Office 365 Group Privacy to Private or Public

How to Change Office 365 Group Privacy?

If you’re using a Microsoft 365 group to collaborate with others, it’s crucial to understand how to change the privacy setting. By default, the privacy is set to public, which means that anyone in your organization can find and join the group. If you want to keep the group private so that only specific people can join and only members can access the group, you’ll need to change the group’s privacy setting. In this article, we’ll show you how to change Microsoft 365 Group privacy from public to private (or vice versa!)

You can change the Office 365 group’s privacy through the Microsoft 365 admin center as an admin. Here is how:

  • Log in to the Microsoft 365 Admin Center site:
  • Expand Groups and Click on the Groups link in the left navigation. 
  • Select the Office 365 group you wish to rename
  • Click on the Edit link next to the Name column in the details pane.
  • On the Edit page, You can change the Privacy of the Office 365 group by selecting Private or Public from the drop-down. 
    change office 365 group privacy to private or public using powershell
  • Click on “Save” to commit your changes. You should see “The group was updated.” message.

Set Office 365 Group Privacy to Private or Public using PowerShell:

Let’s change the privacy of the “[email protected]” group to “Private”.

#Get Credentials to connect
$Credential = Get-Credential
#Connect to Exchange Online
Connect-ExchangeOnline -Credential $Credential -ShowBanner:$False

#Set Office 365 group's privacy to "Private"
Set-UnifiedGroup -Identity "[email protected]" -AccessType Private

#Disconnect Exchange Online
Disconnect-ExchangeOnline -Confirm:$False

Similarly, you can change the group type to “Public” as:

Set-UnifiedGroup -Identity "[email protected]" -AccessType Public

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

One thought on “Set Office 365 Group Privacy to Private or Public using PowerShell

  • Hi , thank you for this. What if we want to edit multiple groups at once , how would the code change? , and | did not work



Leave a Reply