Changing GAM download location

501 views
Skip to first unread message

Rick Davis

unread,
Jul 26, 2016, 1:13:05 PM7/26/16
to Google Apps Manager
New to GAM and python, so I am not sure if this is a GAM or python question. I have gam working and would like to change a few things. I am working on getting all users profile photos and then uploading new photos. This gets me the photo "gam user rdavis get photo" and saves it to my home folder. However, I would like to direct the downloads or save directory when I get "all users" photos. How do I change the file save location? If there is a better place to find basic questions like this, please feel free to direct me there.

Ross Scroggs

unread,
Jul 26, 2016, 2:11:14 PM7/26/16
to google-ap...@googlegroups.com
Rick,

There is no option to save the files in another directory, they are saved in your current working directory.

Ross

On Tue, Jul 26, 2016 at 10:12 AM, Rick Davis <rda...@mercymontessori.org> wrote:
New to GAM and python, so I am not sure if this is a GAM or python question. I have gam working and would like to change a few things. I am working on getting all users profile photos and then uploading new photos. This gets me the photo "gam user rdavis get photo" and saves it to my home folder. However, I would like to direct the downloads or save directory when I get "all users" photos. How do I change the file save location? If there is a better place to find basic questions like this, please feel free to direct me there.

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@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/b5b151a6-4ff4-4492-a854-a648f4e8456e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Ross Scroggs

unread,
Jul 30, 2016, 6:39:01 PM7/30/16
to google-ap...@googlegroups.com
Rick/Nate,

I've put up a new version of my GAM 3.66: https://github.com/taers232c/GAM/releases/tag/3.66

I've updated get photo: gam <UserTypeEntity> get photo [drivedir|(targetfolder <FilePath>)] [noshow]

drivedir specifies the value of the environment variable GAMDRIVEDIR (defaults to current working directory).
targetfolder <FilePath> specifies a user-chosen path.
noshow suppresses dumping the photo data to to stdout.

gam print users primaryemail org > userorgs.csv

primaryEmail,orgUnitPath
test...@domain.com,/Test/Sub1/Sub2

Windows: gam csv userorgs.csv gam user ~primaryEmail get photo noshow targetfolder "c:\UserPhotos~~orgUnitPath~~"
Linux/Mac: gam csv userorgs.csv gam user ~primaryEmail get photo noshow targetfolder "/UserPhotos~~orgUnitPath~~"
By specifying a prefix path at the beginning of targetfolder, everyone's photo is in a subdirectory named after their org unit.
There is no leading / before the ~~ as the orgUnitPath column already has one and Windows correctly interprets / as \ in the name.
Use whatever prefix path you'd like.

I'm assuming a certain level of sanity in the naming of the org units. You can generate userorgs.csv however you'd like if you don't want all users.

Test it out, let me know if this helps,

On Jul 26, 2016, at 10:12 AM, Rick Davis <rda...@mercymontessori.org> wrote:

New to GAM and python, so I am not sure if this is a GAM or python question. I have gam working and would like to change a few things. I am working on getting all users profile photos and then uploading new photos. This gets me the photo "gam user rdavis get photo" and saves it to my home folder. However, I would like to direct the downloads or save directory when I get "all users" photos. How do I change the file save location? If there is a better place to find basic questions like this, please feel free to direct me there.

Reply all
Reply to author
Forward
0 new messages