user change user password from script in Linux

80 views
Skip to first unread message

Lois Bennett

unread,
Aug 18, 2017, 1:15:54 PM8/18/17
to GAM for G Suite
Hello!

I am working on developing a script that can be run from the Linux command line that will allow users to change their passwords for all  accounts in one place.  So I have the AD part worked out and I can use the passwd command wrapped in the python script for LDAP but I still need to solve the gmail/Google.  

Can I set up GAM so that my script can change the user's google password for our domain?  I am already using GAM to allow the system administrators to change a user's password but not the user themself.  

Thanks for your help.

Peace,
Lois 

Lois Bennett, MSEE
Senior System Administrator
Channing  Division of Network Medicine, Brigham & Women's Hospital
A Teaching Affiliate of Harvard Medical School and Harvard School of Public Health

Ross Scroggs

unread,
Aug 18, 2017, 1:26:34 PM8/18/17
to google-ap...@googlegroups.com
Lois,

gam update user UserEmailAddressHere password "WhatTheUserTypedIn"

Ross

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/fa51febd-6067-4ed3-9f13-0ae756781dda%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Walter Moore

unread,
Aug 18, 2017, 1:27:20 PM8/18/17
to google-ap...@googlegroups.com
This should be easy with GAM, since you can change passwords non-interactively... ie

gam update user '[user...@domain.name]' password '[password]'

We do this both with our administrative scripts and with our web password management apps.

I'd be interested how you did the AD side of this. 


--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/fa51febd-6067-4ed3-9f13-0ae756781dda%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
+-----------------------------------------------------------------+
Walter R. Moore --  Sr. Systems Administrator, Eckerd College
moo...@eckerd.edu --  http://home.eckerd.edu/~moorewr

"It was glorious to see -- if your heart were iron,
And you could keep from grieving at all the pain" - The Iliad (13.355)

I'm on twitter: http://twitter.com/moorewreckerd

***Reminder! ITS will never ask you to e-mail your password!***

Lois Bennett

unread,
Aug 22, 2017, 9:59:12 AM8/22/17
to GAM for G Suite
Thanks.  I find I will have to run this as a setuid in order to get permission to run and it doesn't seem to work from the script but that is a different question.

About the AD side: I started from the working script in the answer to this post: https://stackoverflow.com/questions/20875708/how-can-i-change-password-for-domain-userwindows-active-directory-using-python  

As I am learning python in the process it has been interesting.  It does work for me though.



Peace,
Lois

Lois Bennett, MSEE
Senior System Administrator
Channing  Division of Network Medicine, Brigham & Women's Hospital
A Teaching Affiliate of Harvard Medical School and Harvard School of Public Health

On Friday, August 18, 2017 at 1:27:20 PM UTC-4, Walter Moore wrote:
This should be easy with GAM, since you can change passwords non-interactively... ie

gam update user '[user...@domain.name]' password '[password]'

We do this both with our administrative scripts and with our web password management apps.

I'd be interested how you did the AD side of this. 

On Fri, Aug 18, 2017 at 1:15 PM, Lois Bennett <sa...@channing.harvard.edu> wrote:
Hello!

I am working on developing a script that can be run from the Linux command line that will allow users to change their passwords for all  accounts in one place.  So I have the AD part worked out and I can use the passwd command wrapped in the python script for LDAP but I still need to solve the gmail/Google.  

Can I set up GAM so that my script can change the user's google password for our domain?  I am already using GAM to allow the system administrators to change a user's password but not the user themself.  

Thanks for your help.

Peace,
Lois 

Lois Bennett, MSEE
Senior System Administrator
Channing  Division of Network Medicine, Brigham & Women's Hospital
A Teaching Affiliate of Harvard Medical School and Harvard School of Public Health

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages