-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path3-Hide.ps1
More file actions
26 lines (21 loc) · 1.41 KB
/
3-Hide.ps1
File metadata and controls
26 lines (21 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#---------------------------------------------------------------------------------------
# 3-Hide.ps1 - hide a group from the global addressbook
# Microsoft Teams and Office 365 Groups PowerShell Masterclass - by @magrom and @atwork
# https://docs.microsoft.com/en-us/powershell/module/exchange/users-and-groups/set-unifiedgroup?view=exchange-ps
#---------------------------------------------------------------------------------------
Get-UnifiedGroup
# Hide a specific group from Outlook with EXO PS
$groupid = '583616b9-3191-439a-91fb-27add35dc0eb'
# HiddenFromAddressListsEnabled: Does the group appear in the global address list (GAL) and other address lists in your organization.
Set-UnifiedGroup -Identity $groupid -HiddenFromAddressListsEnabled $false
# HiddenFromExchangeClientsEnabled: Is the group hidden from Outlook clients connected to Office 365.
# The group isn't visible in the Outlook left-hand navigation and isn't be visible in the global address list (GAL).
# The group name won't resolve during the creation a new message in Outlook.
Set-UnifiedGroup -Identity $groupid -HiddenFromExchangeClientsEnabled:$false
# Hide multiple groups
$groups = Get-UnifiedGroup -ResultSize Unlimited | ? {$_.DisplayName -like "My*"}
$groups
Foreach ($Group in $Groups) {
Set-UnifiedGroup -Identity $Group.Guid -HiddenFromAddressListsEnabled $false
Set-UnifiedGroup -Identity $Group.Guid -HiddenFromExchangeClientsEnabled:$false
}