GAM Onboarding Script Section not working

24 views
Skip to first unread message

JAYTON RIZZO

unread,
Dec 17, 2025, 12:51:03 PM (2 days ago) Dec 17
to GAM for Google Workspace
Hey All,
I've got a powershell script I've been working on to automate user onboarding, and everything is working fine except for this part:

# --Begin Section that doesn't work--

$Work_Phone = Read-Host "Enter work phone number here (Format: (XXX) XXX-XXXX)"

while($Work_Phone -notmatch '^\(\d{3}\) \d{3}-\d{4}$')
{
    $Work_Phone = Read-Host "Invalid phone number format. Please use (XXX) XXX-XXXX format." -ForegroundColor Red
}

# Add User's Phone Number
Write-Host "Adding work phone number for $email ..." -ForegroundColor Green
gam.exe update user $email phone type work value "$Work_Phone"

# --End Section that doesn't work--

for some reason GAM states that it has updated the user, but it doesn't update them. If I take this part of the script and put it into its own .ps1 file, it works without issue. Any ideas?

Ross Scroggs

unread,
Dec 17, 2025, 12:52:50 PM (2 days ago) Dec 17
to google-ap...@googlegroups.com
Send me a private Meet/Zoom invitation and I'll help.

Ross

--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-apps-manager/86954e2a-2b50-48b0-8459-d43a39ec255dn%40googlegroups.com.


--

Automated System

unread,
Dec 17, 2025, 1:26:41 PM (2 days ago) Dec 17
to google-ap...@googlegroups.com
Hello,

We have received your email regarding: "Re: [GAM] GAM Onboarding
Script Section not working".

Your request has been logged in our system.
UNIQUE CODE: REF-AAC465-24

Please keep this code for your records.
Reply all
Reply to author
Forward
0 new messages