Wednesday, August 27, 2014

How to Create Default Groups in SharePoint Site

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 (E.g. New-SPSite or New-SPWeb), 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: . 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 =""
$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.

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...