SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an FBA site and I need to add "all authenticated users" to a group using PowerShell. How can I do that?

share|improve this question
up vote 3 down vote accepted

You cannot add All Authenticated Users in FBA site. You can do it in Windows sites only. There is however a work around as suggested in this link by creating a role in the directory service, add all existing users to it.

I wonder whether the link provided by you will be of any help. But here is the Powershell equivalent of that code:

$Url = "http://sitename"
                $GroupName = "group name"
                $PermissionLevel = "Read"
                $Description = "group description"              
                $web = Get-SPWeb -Identity $Url
                if ($web.SiteGroups[$GroupName] -ne $null)
                                Write-Host "Group $GroupName already exists!" -foregroundcolor Red
                                $web.SiteGroups.Add($GroupName, $web.Site.Owner, $web.Site.Owner, $Description)
                                $group = $web.SiteGroups[$GroupName]
                                $roleAssignment = new-object Microsoft.SharePoint.SPRoleAssignment($group)
                                $roleDefinition = $web.Site.RootWeb.RoleDefinitions[$PermissionLevel]
                                Write-Host "Group $GroupName created successfully" -foregroundcolor Green
                $user = "c:0(.s|true"
                $web.SiteGroups[$GroupName].AddUser($user, "", "","")               
share|improve this answer
I found this suggestion here:… was wondering how to do it in powershell. – Emad Jan 20 '13 at 2:42
It's not possible, like Nadeem correctly answered earlier (+1 !) To solve your issue, you can add all required FBA roles to the relevant SP built-in group (or create a new one for the case). Since all user should belong to at least one group, you'll add them all in the end. (and you won't need to add a new "AllUsers" group in your FBA Role / Membership. The powershell displayed above will put you on road provided that you have in hand all role to add. – Francois Verbeeck Jan 20 '13 at 12:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.