Powershell - GAM create datatransfer

448 views
Skip to first unread message

Derek A.

unread,
Aug 11, 2016, 11:48:05 AM8/11/16
to Google Apps Manager
Hey Everyone, 

I am having an issue with updating users in bulk, but only with the create datatransfer option. 

For my script I created the Variables: 

$gam = "C:\Scripts\GAM\gam.exe" 
$from_user = "us...@domain.com"
$to_user = "us...@domain.com"

For executing commands I run it as: 

. $gam create datatransfer $from_user drive $to_user privacy_level shared,private

When this executes I get the following message:

Python 2.7.12 64-bit final
google-api-python-client 1.5.0
Windows-8.1-6.3.9600 AMD64
Path: C:\Scripts\GAM

Usage: gam [OPTIONS]...

GAM. Retrieve or set Google Apps domain,
user, group and alias settings. Exhaustive list of commands

Examples:
gam info domain
gam create user jsmith firstname John lastname Smith password secretpass
gam update user jsmith suspended on
gam.exe update group announcements add member jsmith
...

When I execute a delete command everything works fine:

. $gam delete user $to_user

Any idea why the data transfer will not execute?

Ross Scroggs

unread,
Aug 11, 2016, 12:09:48 PM8/11/16
to google-ap...@googlegroups.com
Derek,

This is a bug in 3.65, change drive to Drive in your create datatransfer command.

Ross
--
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/fbc3f604-3e05-403f-bcc3-3b6676c8f426%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Derek A.

unread,
Aug 11, 2016, 1:00:14 PM8/11/16
to Google Apps Manager
I have definitely tried that, I even tried upgraded to 3.66 (https://github.com/taers232c/GAM/releases/tag/v3.66)

I have no problems running this from my computer, and only have this issue when I run it from a different computer (copied the GAM folder from my computer to the other pc)

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

Nate Ferrell

unread,
Aug 11, 2016, 2:57:58 PM8/11/16
to Google Apps Manager
I found that it got weird for me in Powershell when I combined the privacy_level args, so I ended up running them one after the other if I wanted both Private and shared data:


. $gam create datatransfer $from_user drive $to_user privacy_level shared

. $gam create datatransfer $from_user drive $to_user privacy_level private


Also, using Invoke-Expression seems to yield working answers in some situations, may be worth trying

Derek A.

unread,
Aug 11, 2016, 3:07:30 PM8/11/16
to Google Apps Manager
Yeah, after enough frustration I decided to register the path for GAM.exe in the system environment variable "path" 

Then I adjusted my script to do CMD /C "gam create datatransfer $from_user drive $to_user privacy_level shared" which worked perfectly. 
Reply all
Reply to author
Forward
0 new messages