Feature request: Set Associated Groups option for SubSite creation

Jul 2, 2014 at 12:29 PM
Is it possible to have an option when creating a subsite, to set the associated groups. So they will show in the Group Quick Launch menu for the user. This is very welcome when using unique permissions when creating new subsites with CSOM
Jul 30, 2014 at 8:50 PM
You mean to script the three (I believe its three) groups, you need to set, when creating a unique permission site?
Jul 31, 2014 at 7:27 AM
Yes, that is what I mean, the groups are called AssociatedVisitorGroup, AssociatedMemberGroup, AssociatedOwnerGroup. I managed to get this working with this code:
$ctx.Load($web)
$groups = $web.SiteGroups
$ctx.Load($groups)
$ctx.ExecuteQuery()
$group = $groups | where {$_.Title -eq "Site-Visitors"}
$web.AssociatedVisitorGroup = $group
$web.AssociatedVisitorGroup.Update()
$web.Update()
$ctx.ExecuteQuery()