How to Create Default Groups in SharePoint Site?

Problem:
The default SharePoint groups are automatically created when you create a new 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: https://your-sharepoint-site.com/_layouts/permsetup.aspx . Enter group details and hit “Save”.

How to Create Default Site Groups in SharePoint

How to create the 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:

To provision the default site groups, use this 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)

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

2 thoughts on “How to Create Default Groups in SharePoint Site?

  • How can you do this for a subsite that has unique permissions?

    Reply
  • How does this work if you want to create the default groups on a subsite with unique permissions?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *