GAM license deletion

402 views
Skip to first unread message

Dennis Bottin

unread,
May 9, 2024, 4:02:35 AM5/9/24
to google-ap...@googlegroups.com
Hello everyone,
we made a script to manage the user removal.

The script reads the user's information, including the licence associated with it, and obtains the SKU ID. When the script gets to the point of executing the deletion of the user with the command "gam user ~newemail delete licence ~sku" it is executed successfully (see the log's screenshot) but the licence remains associated to the account.

If I run the same command after the script finished, the licence is removed.

Why is this happening?

Thanks,
Dennis


 

Dennis Bottin
Senior Cloud Consultant

Mobile: +39 331 7406836
Huware srl Società Benefit

Via Medardo Rosso, 6 - 20159 Milano

linkedin huware huware.com





Le informazioni contenute in questo messaggio di posta elettronica sono riservate, rivolte esclusivamente al destinatario e non comportano alcun vincolo ne' creano obblighi per la società mittente, salvo ciò che non sia espressamente previsto da un precedente accordo.
Ogni altra persona diversa dal destinatario non può copiare o consegnare il presente messaggio o parte dello stesso a terzi ne' trattare in alcun modo i dati contenuti.
La informiamo che l'utilizzo non autorizzato del messaggio o dei suoi allegati potrebbe costituire reato. Grazie per la collaborazione.
Pensa all'ambiente prima di stampare questa mail.

The information in this e-mail is confidential only addressed to the addressee and it is neither binding on this Company nor to be understood as creating any obligation on its part except where provided for an agreement.
Anyone different from the addressee (who received this e-mail) cannot copy or deliver the message or part of it to a third party, nor deal in any way with the information in this e-mail. Furthermore, the unauthorized use of this message or any attachment could be an offence. Thank you for your cooperation.
Please consider the environment before printing this email
Screenshot 2024-05-09 095906.png

Ross Scroggs

unread,
May 9, 2024, 11:08:41 AM5/9/24
to google-ap...@googlegroups.com
The screenshot shows that the license is going to be deleted, there should be another line immediately following that shows that th license was deleted;
do you see that line?

Send me a Meet/Zoom invitaion if you'd like to investigate.

Ross
----
Ross Scroggs



--
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 on the web visit https://groups.google.com/d/msgid/google-apps-manager/CAMgu1xOjUu1VxxNsv9fCGvvV3T%2BjdMwo1zAwoHO2aPaGDTiJjw%40mail.gmail.com.
<Screenshot 2024-05-09 095906.png>

Dennis Bottin

unread,
May 10, 2024, 3:46:24 AM5/10/24
to GAM for Google Workspace
Hello Ross,
no, I don't see the other line that says license is deleted.

I would add the fact that on the root there is automatic license assignment, 
but during the user removal phase (some rows before the delete license command) 
the account is moved to an OU where automatic assignment is turned off. 

Could a propagation time be needed in this case ?

Thanks

✉ Kevin Melillo

unread,
May 10, 2024, 7:53:40 AM5/10/24
to google-ap...@googlegroups.com
If the user is currently in an OU that has automatic license assignment, then you will not be able to remove it. 
We have auto license assignment as well, but when we offboard a user, we move them into an OU that does not have the assignment.  We can then remove licenses as required.

Dennis Bottin

unread,
May 10, 2024, 8:18:38 AM5/10/24
to google-ap...@googlegroups.com
Thanks Kevin for your reply... but it's just what I just said.

The user in origin is in an OU with automatic assignment, than he is moved in an OU with automatic assignment turned off.
When it's in there... we launch the command to delete the license.

Dennis


 

Dennis Bottin
Senior Cloud Consultant

Mobile: +39 331 7406836
Huware srl Società Benefit

Via Medardo Rosso, 6 - 20159 Milano

linkedin huware huware.com


You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/ka0DvdG1kjE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/CAKM%3DbobKk_XYTTRHch8Yp6HJ79T584LHM0h%3D%3D9eWScSCJH_K2w%40mail.gmail.com.

✉ Kevin Melillo

unread,
May 10, 2024, 9:05:55 AM5/10/24
to google-ap...@googlegroups.com
Too little coffee on my side!  Sorry for that.  

I would like to add with our offboarding process we give the manager delegate access for 90 days.  Once this time period is up, we remove the license, and suspend the user, so we would not have the same propagation issue that may be occurring for you.

During our offboarding process we have a custom field that updates, and notes the termination date on the account. 
On the first Monday of each month, I run a report of the terminated users OU, and anyone over 3 months old gets the license removed.  We are only able to do this because we record the termination date.


Dennis Bottin

unread,
May 10, 2024, 9:41:16 AM5/10/24
to google-ap...@googlegroups.com
Coffee is never enough... 

I also thought it might be a solution the one you proposed... 
but I wondered why if I run that command only at the end of the script, the licence is correctly removed.

Dennis


 

Dennis Bottin
Senior Cloud Consultant

Mobile: +39 331 7406836
Huware srl Società Benefit

Via Medardo Rosso, 6 - 20159 Milano

linkedin huware huware.com


Reply all
Reply to author
Forward
0 new messages