powershell script to get ALL users for a permission level

Hi There

I am looking for a powershell script to get list of all users associated with a specific permission level for a web application.

for example I need list of all users that have the "Designer" or "Contributor" right permission level for a web application.

Will appreciate any help in relation to this.

Thank you

July 23rd, 2015 2:08am

you can use this script to permission via group membership

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

Free Windows Admin Tool Kit Click here and download it now
July 23rd, 2015 3:08am

Hi There

thank you but it only gets permission of the top level site. I have many subsites and sites with unique permissions under the top site but it does not find the permissions in them.is there a script to get permissions of subsite n ones with unqiue permissions.

Thank you

July 27th, 2015 1:39am

I'd suggest you learn PowerShell to be honest. Or even google this as it would have been done before, but here you go a quick look at was was given you could see you needed to get all the sites and then foreach through them with the code given:

$URL = "Site"
$Sites = Get-SPWebApplication $url | Get-SPSite -Limit All

foreach ($page in $sites)
{

Get-SPUser -Web $page.url | Select UserLogin, @{name="Given Roles";expression={$_.Roles}}, @{name=Given Groups;expression={$_.Groups | %{$_.Roles}}},Groups | format-Table -auto


}

Free Windows Admin Tool Kit Click here and download it now
July 27th, 2015 3:38am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics