Make office365 security group or Microsoft Teams group from CSV

Copper Contributor

Hi all,

 

Is there a possible way to make a office365 security group or a Microsoft Teams group from a CSV file?

 

 

Kind Regards,

 

Zenna

2 Replies

Yes, that's one of the main reasons we use PowerShell for. There are plenty examples available online and here on the forums, look them up.

@zenna 

 

Hi @zenna

 

  • Create a CSV file with one column as shown in the Screenshot below.

zenna.PNG

import-csv -Path "C:\Users\user\Desktop\book1.csv" | ForEach-Object { Add-UnifiedGroupLinks -Identity "<nameofO365group>" -LinkType "members" -Links $_.users }

*replace -Path with the path of the CSV file you created and <nameofO365group> with the name of the Group (remove the angle brackets).

 

This should work