SharePoint 2013 with Free ASP.NET Hosting – How to Create the default groups via PowerShell in SharePoint ?
In this post, let me tell you about Create the default groups via PowerShell in SharePoint 2013. If your site is missing the three default groups “Visitors”, “Members” and “Owners”, you can create them easily with PowerShell or the Object Model. And then write the following code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Add-PSSnapin Microsoft.SharePoint.PowerShell $web = Get-SPWeb https://yoursite.com if ($web.AssociatedVisitorGroup -eq $null) { Write-Host 'The Visitor Group does not exist. It will be created...' -ForegroundColor DarkYellow $currentLogin = $web.CurrentUser.LoginName if ($web.CurrentUser.IsSiteAdmin -eq $false){ Write-Host ('The user '+$currentLogin+' needs to be a SiteCollection administrator, to create the default groups.') -ForegroundColor Red return } $web.CreateDefaultAssociatedGroups($currentLogin, $currentLogin, [System.String].Empty) Write-Host 'The default Groups have been created.' -ForegroundColor Green } else { Write-Host 'The Visitor Group already exists.' -ForegroundColor Green } |
I hope it works for you! Best SharePoint 2013 Hosting Recommendation HostForLIFE.eu HostForLIFE.eu offer the Best, Cheap and Recommended SharePoint 2013 hosting start from €9.99/month. They can load your site against anticipated…