This module can be used to watch specific groups for membership changes, and then triggers the hide or unhide of the recipient object from the address lists.
Use this command to get the current members list of the target group.
The output values are the members' ObjectGUID.
GetCurrentGroupMembers [-GroupID] <string>
[<CommonParameters>]
Command to compare the current member list and the previous member list to determine whether new members are added or removed.
CompareGroupMembers [-CurrentMemberList] <string[]>
[-PreviousMemberList] <string[]> [<CommonParameters>]
Command to hide recipient object from the address list
HideFromGal [-HideList] <string[]>
[<CommonParameters>]
Command to unhide recipient object from the address list
UnHideFromGal [-HideList] <string[]>
[<CommonParameters>]
The main command to execute to perform the update workflow.
This also has the option to trigger an update of the Global Address List.
UpdateAddressListVisibility [-GroupID] <string>
[-HistoryFile] <string>
[-UpdatelGlobalAddressList]
[<CommonParameters>]
You need to be assigned permissions before you can use this function properly. This module requires the ActiveDirectory Module and the Microsoft.Exchange.Management.PowerShell.E2010 Snap-In - which is included in the Exchange Management Tools.
You can install this several ways
- Download the code (zip)
- Extract to your chosen $env:PSModulePath
- (eg. C:\Program Files\WindowsPowerShell\Modules)
- The folder structure must be "\ExchangeAddressListVisibilityWatcher<version>"
- (eg. C:\Program Files\WindowsPowerShell\Modules\ExchangeAddressListVisibilityWatcher\1.0)
If you have PowerShell version 5.0+
Install-Module -Name ExchangeAddressListVisibilityWatcher
Get-Module ExchangeAddressListVisibilityWatcher -ListAvailable
GetCurrentGroupMembers -GroupID GroupA | Out-File C:\history\GroupA-History.txt
Under normal circumstances, you only this to do this once for each group you want to watch. This example gets the member list of the group GroupA and save to file C:\history\GroupA-History.txt
UpdateAddressListVisibility -GroupID GroupA -HistoryFile C:\history\GroupA-History.txt
This example gets the current members of GroupA, compare it with the previous member list GroupA, and then perform the hide or unhide depending on membership changes.