taers232c / GAMADV-XTD3

Command line tool to manage Google Workspace
691 stars 86 forks source link

GAM migration project #329

Closed CertifiedCIO-jchambers closed 1 year ago

CertifiedCIO-jchambers commented 1 year ago

I'm trying to migrate a large client from GSuite to 365, and I want to write the tools in a way that can be reused for similar projects in the future.

Best way I can think of to audit the Workspace shared drives to do any prep that needs to be done before throwing it in Sharepoint is to use Powershell to drive GAMADV commands. I've already exported the teamdrive list to a CSV, and began reading the CSV into the powershell script and trying to run GAM commands from there... But this is where I run into a problem.

If I run "C:\GAMADV-XTD3\GAM user [username] print filelist select teamdriveid [id] allfields 1>"c:\gamwork\drives[drivename].csv" from GAM itself, it spits out the CSV no problem. But when I use powershell to do run the exact same command, I'll get something like this: image And the resulting CSV isn't in CSV format... the delimiting commas will be there, but it'll still end up all lumped together in the first cell.

I know the PS is generating the GAM command correctly, because if I instead output the $PrintCommand variables to a batch file and run that separately, it executes without a hitch. So why is Powershell trying to run the print command failing here? It worked perfectly with the preceding command to add my user as an organizer on all the shared drives.

taers232c commented 1 year ago

Send me a Meet/Zoom invitation and I'll help

Ross

taers232c commented 1 year ago

gam redirect csv drives[drivename].csv user [username] print filelist select teamdriveid [id] allfields

CertifiedCIO-jchambers commented 1 year ago

Fantastic, this is working beautifully, thank you!

From: Ross Scroggs @.> Sent: Wednesday, February 15, 2023 1:16 PM To: taers232c/GAMADV-XTD3 @.> Cc: Joel Chambers @.>; Author @.> Subject: Re: [taers232c/GAMADV-XTD3] GAM migration project (Issue #329)

gam redirect csv drives[drivename].csv user [username] print filelist select teamdriveid [id] allfields

— Reply to this email directly, view it on GitHubhttps://github.com/taers232c/GAMADV-XTD3/issues/329#issuecomment-1431806799, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A55OEU3LPMQC5UZUMAXBTNDWXUMMNANCNFSM6AAAAAAU5E4LDI. You are receiving this because you authored the thread.Message ID: @.**@.>>

jay-eleven commented 1 year ago

Solved, closing...