Wednesday, August 27, 2014

How to Create Default Groups in SharePoint Site

Problem: The default SharePoint groups are created automatically when you create a site collection through SharePoint Web UI. But, when you Create SharePoint sites programmatically or with PowerShell, The default site groups (Such as: Visitors, Members, Owners) are not created automatically

Default groups creation from UI: You can get the default group page from SharePoint UI by navigating to :  http://your-sharepoint-site.com/_layouts/permsetup.aspx . Enter group details and hit "Save".

How to Create Default Site Groups in SharePoint
How to create default SharePoint groups:
You have to call the method: SPWeb.CreateDefaultAssociatedGroups explicitly. to create default user groups in SharePoint.

Create Default User Groups programmatically using PowerShell:
Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue

#Variables for Site collection
$SiteURL ="https://intranet.crescent.com"
$Site = Get-SPSite $SiteURL

#get the Root Web object
$RootWeb = $Site.RootWeb

$GroupOwner = "i:0#.w|global\salaudeen" 
$RootWeb.CreateDefaultAssociatedGroups($GroupOwner, "", $RootWeb.title)



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...