Find All ‘Authenticated Users’ instances in a SharePoint database

I reacently had to find every instance of ‘All Authenticated users’ in a site collection.

Powershell to the rescue:

$site = Get-SPSite http://’WebApp’
$groups = $site.RootWeb.sitegroups
foreach ($grp in $groups) {“Group: ” + $; foreach ($user in $grp.users) {”  User: ” + $} }

$spWeb = Get-SPWeb http://WebApp
$theuser = $spWeb.AllUsers.Item(“NT Authority\Authenticated Users”)
foreach ($grp in $theuser.Groups) {$}

Handy, my next step is to remove the instances of Authenticated Users and replace them with the specific AD Group.


Also liked this: Show All Effective Permissions in a site:

$urlWeb = "http://mycompany/sites/mydepartment"

Get-SPUser -Web $urlWeb | select UserLogin, @{name="Exlicit given roles";expression={$_.Roles}}, @{name="Roles given via groups";expression={$_.Groups | %{$_.Roles}}},Groups | format-Table -auto