diff --git a/src/gam-install.sh b/src/gam-install.sh index 29545924..39d392d9 100755 --- a/src/gam-install.sh +++ b/src/gam-install.sh @@ -12,6 +12,7 @@ OPTIONS: -o OS we are running (linux, macos). Default is to detect your OS with "uname -s". -p Profile update (true, false). Should script add gam command to environment. Default is true. -u Admin user email address to use with GAM. Default is to prompt. + -r Regular user email address. Used to test service account access to user data. Default is to prompt. -v Version to install (latest, prerelease, draft, 3.8, etc). Default is latest. EOF } @@ -22,7 +23,8 @@ gamos=$(uname -s) update_profile=true gamversion="latest" adminuser="" -while getopts "hd:a:o:p:u:v:" OPTION +regularuser="" +while getopts "hd:a:o:p:u:r:v:" OPTION do case $OPTION in h) usage; exit;; @@ -31,6 +33,7 @@ do o) gamos=$OPTARG;; p) update_profile=$OPTARG;; u) adminuser=$OPTARG;; + r) regularuser=$OPTARG;; v) gamversion=$OPTARG;; ?) usage; exit;; esac @@ -236,6 +239,9 @@ while $project_created; do read -p "Are you ready to authorize GAM to manage G Suite user data and settings? (yes or no) " yn case $yn in [Yy]*) + if [ "$regularuser" == "" ]; then + read -p "Please enter the email address of a regular G Suite user: " regularuser + fi echo_yellow "Great! Checking service account scopes.This will fail the first time. Follow the steps to authorize and retry. It can take a few minutes for scopes to PASS after they've been authorized in the admin console." $target_dir/gam/gam user $adminuser check serviceaccount rc=$? diff --git a/src/gam-setup.bat b/src/gam-setup.bat index 9a52f300..b25f885c 100644 --- a/src/gam-setup.bat +++ b/src/gam-setup.bat @@ -60,8 +60,10 @@ @ echo Please answer y or n. @ goto saauth ) +@echo( +@set /p regularuser= "Please enter the email address of a regular G Suite user: " @echo Great! Checking service account scopes. This will fail the first time. Follow the steps to authorize and retry. It can take a few minutes for scopes to PASS after they've been authorized in the admin console. -@gam user %adminemail% check serviceaccount +@gam user %regularuser% check serviceaccount @if not ERRORLEVEL 1 goto sadone @echo( @echo Service account authorization failed. Confirm you entered the scopes correctly in the admin console. It can take a few minutes for scopes to PASS after they are entered in the admin console so if you're sure you entered them correctly, go grab a coffee and then hit Y to try again. Say N to skip admin authorization. @@ -69,4 +71,4 @@ :sadone echo GAM installation and setup complete! -:alldone \ No newline at end of file +:alldone