Office 365 Powershell
1 TopicGroup based Licenses for Multiple users in Multiple groups
I have a scenario where i need to take input from the CSV file for multiple users who have their UserprincipalName, Security Group and Action (Add or Remove).I need to write a power shell script to add the users automatically after taking the inputs from the CSV file. UserPrincipalName, Secuirty Group, Action test1,G1,Add Test2,G2,Add .... .... Tes20,G12,Remove I used this for single user Connect-MsolService $groups = Get-MsolGroup -all -grouptype security | where {$_.DisplayName -eq "G1"} $users = Get-MsolUser -all | where {$_.UserPrincipalName -like "Test*"} $users | Foreach {Add-MsolGroupMember -GroupObjectId $group.objectid -GroupMemberType “user” -GroupMemberObjectId $_.objectid} How would you do it for the above scenario for multiple users?897Views0likes1Comment