Hi,
I have output a dynamic DL to a variable $people but am unable to add users to a sharepoint group with the method below:
$poeple | foreach {Add-SPOUser -Group "US Team Members" -Site https://contoso.sharepoint.com -LoginName $_.PrimarySMTPAddress}
Output for the above command is Add-SPOUser : Cannot bind argument to parameter 'LoginName'
Which tells me there is an issue with my variable supplying the PrimarySMTPAddress property. When I check against get-member, it is definitely there. See below:
PS> $people | gm | findstr -i primary
PrimarySmtpAddress Property System.String {get;set;}
I am not sure how to proceed about accomplishing this or if it is even possible. Any help is greatly apprecated! Thanks all!
- Edited by dmgale Tuesday, February 17, 2015 11:29 PM