PowerShell script cannot find user permissions given directly (can find if permissions given in a group) - Please help.

Hi there,
I need to find ALL SharePOint sites/subsites/locations where "Domain\john" has any level of access. 
Following script works if the permissions were given to Domain\john via a group - but this does not work if the permissions were given directly to the user (i.e. user is NOT part of the group).
$weburl = "http://dev"
Get-SPUser -web $weburl -Limit All | ?{$_.UserLogin -eq "Domin\john"} | select UserLogin, @{name="Url";expression={$_.ParentWeb.Url}}, @{name="Explicit given roles";expression={$_.Roles}}, @{name="Roles given via groups";expression={$_.Groups | %{$_.Roles}}},Groups | Out-String -Width 4096
Help will be appreciated.
Thank you.

I don't really understand your request. It sounds like you just want to know the permissions per-user
$weburl = "http://dev"
Get-SPUser -web $weburl -Limit All | ?{$_.UserLogin} | select UserLogin, @{name="Url";expression={$_.ParentWeb.Url}}, @{name="Explicit given roles";expression={$_.Roles}}, @{name="Roles given via groups";expression={$_.Groups | %{$_.Roles}}},Groups | Out-String -Width 4096
This will just return all the users and their permissions.
If this is helpful please mark it so. Also if this solved your problem mark as answer.

Similar Messages

Maybe you are looking for