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: ” + $grp.name; foreach ($user in $grp.users) {”  User: ” + $user.name} }
$site.Dispose()

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

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:

http://vlasenko.org/2010/03/19/sharepoint-2010-powershell-how-to-get-user-permissions-report/

$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