Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

How to add default associated groups when creating new site

$
0
0

Hi All,

I am trying to create a new subsite in sharepoint 2013 using CSOM (code is mentioned below). But no default groups (MEMBER, VISITOR, OWNER) are getting created in that site. When we try through UI we will got through a page "Set Up Groups for this Site" where we can specify these details.. Is it possible to do the same (creating default groups together with the site creation) through CSOM or powershell.

CSOM code:

WebCreationInformation creation = new WebCreationInformation();
            creation.Url = "NewSubSite6";
            creation.Title = "NewSubSite6";
            creation.UseSamePermissionsAsParentSite = false;
            Web newWeb = clientContext.Web.Webs.Add(creation);
            //clientContext.Load(newWeb);
            clientContext.ExecuteQuery();

Regards,

Shahabas


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>