Forum Discussion
Andy Kw
Mar 01, 2018Brass Contributor
How to retrieve the object id of a list of users from a csv file with UserPrincipleName?
I'm trying to bulk load a csv file of users into a security group.
The line below would do what I want to do except that is asking for all users from a specific domain.
$users = get-msolu...
VasilMichev
Mar 02, 2018MVP
You can try something like this:
$users | foreach {add-msolgroupmember -groupobjectid $group.objectid -groupmembertype “user” -GroupMemberObjectId (Get-MsolUser -UserPrincipalName $_.UserPrincipalName).objectid}