foreach ($user in $students)
{
. C:\GAMADV\gam.exe update group $($user.ipPhone) add member $($user.mail)
}gam.exe : Command: C:\GAMADV\gam.exe update group add >>>member<<<
At C:\PowerShell\Students\GAM\GAM_PrintGroups_test.ps1:31 char:1
+ &C:\GAMADV\gam.exe update group $($user.ipPhone) add member $($user.m ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Command: C:\GAM...d >>>member<<< :String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
ERROR: Invalid argument
Help: Syntax in file C:\GAMADV\GamCommands.txt
Help: Documentation is at https://github.com/taers232c/GAMADV-X/wiki--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" 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/7c0c5c12-ac0c-48ac-8b01-58b7c8008d9b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
$students = Get-ADUser -filter {mail -like "*@domain.com"} -Searchbase "OU=Test,DC=domain,DC=local" -ResultSetSize $null –Properties mail,ipPhone `
foreach ($user in $students)
{
& C:\GAMADV\gam.exe update group $($user.ipPhone) add member $($user.mail)
}