Add Windows AD Account

160 views
Skip to first unread message

J Cracknell

unread,
Jan 22, 2021, 3:08:30 PM1/22/21
to GAM for Google Workspace
Hi

We use Google Credential Provider for Windows (GCPW)

Is there any way I can extract and update the AD Accounts information under Enhanced Desktop Security?

So my username is jcracknell and my AD login would be DOMAIN\jcracknell

Hope that makes sense.

James

Brian Kim

unread,
Jan 23, 2021, 8:26:48 AM1/23/21
to GAM for Google Workspace
You will first want to add a custom schema if you haven't already.

gam create schema "Enhanced_desktop_security" field "AD_accounts" type string multivalued restricted endfield

Then you can populate the values in the new custom schema

gam csv users.csv gam update user ~username Enhanced_desktop_security.AD_accounts multivalued ~sAMAccountName

J Cracknell

unread,
Jan 23, 2021, 8:40:19 AM1/23/21
to google-ap...@googlegroups.com
That's brilliant but is there anyway I can do this without a CSV? As in take the username which is my case jcracknell and stick in my domain\username (both usernames for the windows domain and Google are the same)

--
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/9956JUoMmo0/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/d5e316f8-afd6-4c95-8dde-dbb323e34565n%40googlegroups.com.

Please familiarise yourself with our email disclaimer, which includes conditions regarding communication with our school.

Please familiarise yourself with our email disclaimer, which includes conditions regarding communication with our school.

Brian Kim

unread,
Jan 23, 2021, 9:17:55 AM1/23/21
to GAM for Google Workspace
csv or a google sheet will be needed for bulk processing.
https://github.com/taers232c/GAMADV-XTD3/wiki/Bulk-Processing

if you want to do it for a single user
gam update user jcracknell Enhanced_desktop_security.AD_accounts multivalued DOMAIN\jcracknell

Jay Lee

unread,
Jan 23, 2021, 10:10:34 AM1/23/21
to google-ap...@googlegroups.com
If you want to just do it for all Google users try:

gam csv users.csv gam update user ~primaryEmail Enhanced_desktop_security.AD_accounts multivalued DOMAIN\~~primaryEmail~~

Jay


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/CAPNmg5TmV%3D-u5X9yZgC-QJ8v1ty84vY3LcohB1j%3DSy4kaikJbw%40mail.gmail.com.

Brian Kim

unread,
Jan 23, 2021, 12:16:20 PM1/23/21
to GAM for Google Workspace
gam print users > users.csv
sed 's/@domain.com//' users.csv - this removes @domain.com from user's email address.

then run Jay's command.

I'm sure there is a way to pipe from one command to the next, but it's always good to validate output first.

J Cracknell

unread,
Jan 23, 2021, 2:22:27 PM1/23/21
to google-ap...@googlegroups.com
Hi Brian

Many thanks for this - just the first command doesn't put 'primaryEmail' as a CSV heading.

I am doing this with a Window batch script so downloaded fart to remove the domain name

Apart from having to do that - it works

J.


Adam Strugatch

unread,
May 2, 2022, 10:58:37 AM5/2/22
to GAM for Google Workspace
Would you mind sharing your final script (sanitized of course)? And any tools you needed on Windows to make it work? 

Are all your users on one domain? No sub domains?

Avrohom Eliezer Friedman

unread,
May 2, 2022, 11:24:31 AM5/2/22
to google-ap...@googlegroups.com
when we create a new user  - we always do it from GAM and this is part of the command

Enhanced_desktop_security.AD_accounts multivalued 'domain\'~~username~~


-----
Avrohom Eliezer Friedman
IT Director

Yeshiva Toras Chaim Toras Emes
305-944-5344 x222 (o)
305-494-2055 (cell)
aefri...@ytcte.org




Adam Strugatch

unread,
May 2, 2022, 11:31:21 AM5/2/22
to GAM for Google Workspace
Avrohom,

Does your custom schema have the underscores? I see it set up two different ways in the instructions from Google. One includes underscores and one does not. 

So your csv includes your contoso.com\user info? We usually sync with GCDS, but there is literally zero google documentation on handling this with GCDS despite the fact that it says it is supported in the docs.
Reply all
Reply to author
Forward
0 new messages