33 C
Dubai
Tuesday, September 21, 2021
spot_img

Adding members to Office 365 Security Group via csv

Make sure you Connected to Exchange Online PowerShell

Connect-MsolService

You can get the object id of the group you are planning to add from Azure Active directory portal



CSV Sample – Double quotes is very important otherwise you may see undesirable additions.

Import-Csv users.csv |ForEach-Object {Add-MsolGroupMember -GroupObjectId 6e5db514-b162-4de4-ab93-3f1944ea4167 -GroupMemberType user -GroupMemberObjectId (Get-MsolUser -UserPrincipalName $_.userprincipalname).ObjectId}

 

Satheshwaran Manoharanhttps://www.azure365pro.com
Satheshwaran Manoharan is an Microsoft Office Server and Services MVP , Publisher of Azure365pro.com. Specialized in Office365 / Microsoft Exchange / Virtualization , Sathesh is an Messaging Expert supporting/Designing/Deploying many medium size businesses to large enterprises when it comes to Corporate messaging and Virtualization Infrastructure

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here