Forum Discussion
Default Group Privacy Setting
Does anyone know of a PowerShell script whereby you can convert all Public groups to Private ?
The idea is I can perform a "sweep up" in case any users created Public groups (for data privacy reasons we want all groups to be Private)
Thanks in advance
- Eugene BarnardtMar 22, 2017Copper ContributorI found it:
Get-UnifiedGroup | Where {$_.AccessType -eq "Public"} | Set-UnifiedGroup -AccessType Private- cfiessingerMar 22, 2017
Microsoft
A more advance version based on classification:
#...................................
# Variables:
# Cut off date in days
# Classification
#...................................
$cutoffdate = ((Get-Date).AddDays(-10))
$classification = "High"# Retrieve recently created groups with accesstype set to PUBLIC
$Groups = Get-UnifiedGroup | Where-Object {
$_.WhenCreated -ge $cutoffdate -and $_.AccessType -eq 'Public' -and $_.Classification -eq $classification } `
| Sort-Object whencreated | Select DisplayName, WhenCreated, AccessType, Classification, ManagedBy# For each new group update set accesstype to PRIVATE
ForEach ($G in $Groups) {
Set-UnifiedGroup -Identity $G.DisplayName -AccessType 'Private'
Write-Host "The following Group privacy setting was updated:" $G.DisplayName
}
- David RosenthalMar 22, 2017
Microsoft
Not a script, but here is the PowerShell you need to create it: https://technet.microsoft.com/library/mt238274(v=exchg.160).aspx