Fairly niche one this one. Needed to hide all the users in a specific group from the GSuite Domain’s Global Address List

Powershell to the rescue. Pulling through all the users in a specific searchbase and iterating through them with the GAM gal off command.

Get-ADUser -Filter * -SearchBase "OU=Name,DC=domain,DC=local" -Properties mail | ForEach-Object { 

    .\gam.exe update user $_.mail gal off


The script pulls the accounts in the specified OU, including their mail attribute, in to an object. It iterates through that object calling gam.exe, selecting the user by email address and setting gal off.

Categories: Powershell


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.