Re: [GAM] import csv file via window powershell and have update org problem. What should I do Please help.

155 views
Skip to first unread message

Terry Chambers

unread,
Apr 10, 2013, 7:59:08 AM4/10/13
to google-ap...@googlegroups.com
In your CSV file you will need to put double quotes around the Org Name.

If you do not have this as a single value, the simplest thing to do is to build your CSV in Google Sheets or Excel first and then compute the value of "org" by combining "orgfather" and "orgparent" and placing quotes around the resulting value. 

You might need some trial and error to get the formula correct if you are not a spreadsheet guru.  Hint - use the "Concat" (Google) or "Concatenate" (Excel) command.

You can test this out by hard-coding your batch script for the Org value.

One last thing, your "update org" command syntax seems to put the user's name in the Org.  Unless you are creating an Org for every user (not recommended) then that is not the correct syntax.

Good luck.

Terry






On Wed, Apr 10, 2013 at 4:37 AM, Sarocha <sar...@crmc-academy.com> wrote:
I use this code


$UserList=IMPORT-CSV D:\script\uploadim124.csv

FOREACH ($Person in $UserList) 
{
c:\gam\gam.exe create user $($Person.emailaddress) firstname $($Person.firstname) lastname $($Person.lastname) password $($Person.password)
c:\gam\gam.exe update group $($Person.groups) add member $($Person.emailaddress)

This code is a problem. I want to add groups of user in org. 
But org have their parent org. And in $($Person.orgparent) have space inside the information. Have I use quote?
And how to use it?

c:\gam\gam.exe update org "'" $($Person.orgfather)/ $($Person.orgparent)/ $($Person.name) "'" addgroup $($Person.groups)
}

Please help
Thank

--
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 http://groups.google.com/group/google-apps-manager?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages