3

Do you know if there's a way to create several groups in sharepoint online by using powershell for instance?

Thank you.

2
$grpname = "Music","Movies","Famous_Singers","HollyWood"  

Connect-SPOService -Url https://contoso-admin.sharepoint.com -credential admin@contoso.com

foreach ($group in $grpname) { 
    New-SPOSiteGroup -Site https://contoso.sharepoint.com/sites/siteA -Group $group -PermissionLevels "Full Control"
}

The above code is not tested, but logic should be correct

Reference here

  • Thank you. The idea is to create several groups at the same time. Do you know how can I do it? – Peter Smp May 31 '17 at 10:20
  • Add some group names in array and then use for each loop – SharePointMan May 31 '17 at 10:20
  • see my updated answer – SharePointMan May 31 '17 at 10:23
  • Thank you. Is there way to execute it without the permission level? and how can I specify the group owner of each group? – Peter Smp May 31 '17 at 10:32
  • checkout this support.office.com/en-gb/article/… – SharePointMan May 31 '17 at 10:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.