I am attempting to delete retired devices from the company owned devices section in the Admin Console. I have a large amount of devices so I am trying to delete them through GAM. I have a gsheet with a list of serial numbers. I am having issues using this with a gam command.
After some trial and error I have found the correct format of the command to delete the records. Now I am attempting to delete them in bulk using the csv gsheet option. When I run the following it doesn't appear to be replacing the variable with the serial numbers.
gam csv gsheet <
us...@domain.com> <Document_ID> <Sheet_Name> gam delete device query "serial:~sn" doit
The output just shows the same two lines over and over again:
Getting all Devices that match query (serial:~sn), may take some time on a large Google Workspace Account...
Got 0 Devices...
I can confirm that the values I have for the user, Document_ID and sheet name are correct because if I remove "query "serial:" form the command and just leave ~sn the output shows the serial numbers. However it fails because it needs the query to work.
Is it possible to include the variable in the query?