Renaming and moving of users to a new sub-domain

1,767 views
Skip to first unread message

Limoke Oscar Mahagayu

unread,
May 17, 2012, 8:02:30 AM5/17/12
to google-ap...@googlegroups.com

Hi,

I am working on a way move users from one  domain to another sub-domain. 

I am trying to find the implementation of this in GAM . The Google Apps Support has a nice way to do it HERE. Could you please let me know of any way to do it in bulk via GAM or otherwise?

I have used the myweb.org as the main organization domain and the gam.myweb.org as the sub-organization domain. 


Regards,
Limoke Oscar,

Jay Lee

unread,
May 17, 2012, 8:12:18 AM5/17/12
to google-ap...@googlegroups.com
Hi Limoke,

  The command is documented at:


a basic example would be:

gam update user lim...@myweb.org username lim...@gam.myweb.org

there are a number of ways to do this in bulk that all pretty much come down to using a shell to re-run gam multiple times for each rename. One of the easiest ways is to just use a text editor to create a batch or shell script file that has all the gam commands listed out explicitly:

gam update user us...@myweb.org username us...@gam.myweb.org
gam update user us...@myweb.org username us...@gam.myweb.org
gam update user us...@myweb.org username us...@gam.myweb.org
gam update user us...@myweb.org username us...@gam.myweb.org
...

the Wiki also documents how to use a Powershell script and a CSV to loop through the CSV and apply the changes. If you're using Linux or Mac OS, there are also ways to use a shell script to loop through a CSV for them.

Hope this helps.

Regards,

Jay Lee
LCS Deployment Lead  | Dito
(267) 712-9533
j...@ditoweb.com





--
You received this message because you are subscribed to the "Google Apps Manager" group.
To post to this group, send email to
google-ap...@googlegroups.com
To unsubscribe from this group, send email to
google-apps-man...@googlegroups.com
For more options, visit this group at
https://groups.google.com/forum/#!forum/google-apps-manager

Limoke Oscar

unread,
May 17, 2012, 9:22:28 AM5/17/12
to google-ap...@googlegroups.com
Hi Jay,

Thank you so much. Am using a mac and was hoping I do it all via a CSV file . I.e. having all users in myweb.org in a CSV file that I would like to rename/move to gam.myweb.org

Thanks,

Sean Daly

unread,
Feb 12, 2013, 11:01:46 AM2/12/13
to google-ap...@googlegroups.com
I am also attempting to do this through a batch script, so I have a .csv with firstname, lastname, username (which is firstname.lastname) but there is no way I'm typing user...@myco.com for a thousand users.  Is there a way to put that into a script like:  $(entry.username)'@myco.com' ?  (Obviously that doesn't work, but I know nothing about splatting or Powershell scripting.)

Meshack Musangi

unread,
May 30, 2014, 6:41:57 AM5/30/14
to google-ap...@googlegroups.com
Hi Jay,
the best way to add the @myco.com part to all your users at once is to use the concatenate function in excel then save the file as a CSV when done. Using the Concatenate function is pretty easy, just google it.

Brandon U.

unread,
May 30, 2014, 10:41:45 AM5/30/14
to google-ap...@googlegroups.com
@Sean, I am using Powershell for my creation of accounts, maybe it can help you with your issue.

Param(
   
[parameter(Mandatory=$true)]
   
[alias("f")]
    $file
)

Set-Alias -Name gam -Value c:\Usher\gam\gam.exe -Description "Google-Apps-Manager Alias" -Force

$list
= Import-Csv $file
foreach($entry in $list) {
    gam create user
"$($entry.username)@myco.com" firstname "$($entry.firstname)" lastname "$($entry.lastname)" password "$($entry.password)" changepassword off agreedtoterms on org "$($entry.org)"
 
}


The CSV has a header of:

username, firstname, lastname, password, org

If you don't want to separate people into different orgs, just remove that part from the command and leave the CSV fields blank.

If you want to do aliases:

Param(
   
[parameter(Mandatory=$true)]
   
[alias("f")]
    $file
)

Set-Alias -Name gam -Value c:\Usher\gam\gam.exe -Description "Google-Apps-Manager Alias" -Force

$list
= Import-Csv $file
foreach($entry in $list) {
    gam create
alias "$($entry.username)@myco.com" user "$($entry.username)@oldco.com"
 
}

Reply all
Reply to author
Forward
0 new messages