How do I escape # in an ou?

44 views
Skip to first unread message

Nestor Cortes

unread,
Mar 12, 2025, 6:41:04 PMMar 12
to GAM for Google Workspace
I am trying to delete multiple OU's via the following command

gam csv ./mySheet.csv gam delete orgs "~OU"

Where each OU entry is of the following format:
/1/2/3/cart #1234/

I can't seem to properly escape the '#' character and thus my OU's aren't found.

Ross Scroggs

unread,
Mar 12, 2025, 7:01:21 PMMar 12
to google-ap...@googlegroups.com
The API library is broken, OUs with + or # in their name are not properly processed.
I entered a bug report years ago about the + problem an nothing every happened.
You'll have to list the OUs and delete the desired ones by their ID.

Use org instead of orgs i the command to avoid other quoting issued.

gam csv ./mySheet.csv gam delete org "~OUId"

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 visit https://groups.google.com/d/msgid/google-apps-manager/799c7e4e-287b-4baa-a3ef-71346aaccdb8n%40googlegroups.com.

Nestor Cortes

unread,
Mar 12, 2025, 7:01:38 PMMar 12
to GAM for Google Workspace
I've tried editing each entry to include a backslash before the # like so
/12/3/cart \#1234/ 
however this didn't help.

Ross Scroggs

unread,
Mar 12, 2025, 7:03:44 PMMar 12
to google-ap...@googlegroups.com
The OU id is like this: id:123abc456

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.

Nestor Cortes

unread,
Mar 12, 2025, 7:04:07 PMMar 12
to GAM for Google Workspace
Good to know it wasn't just me. Thank you.

Jay Lee

unread,
Mar 12, 2025, 8:29:39 PMMar 12
to google-ap...@googlegroups.com
If it's causing these levels of issues it may be worth just renaming the OU.

Jay

Reply all
Reply to author
Forward
0 new messages