Last active
February 6, 2017 13:53
-
-
Save AdamNaj/0add451a264d8a63d3eb0bbafb5bf501 to your computer and use it in GitHub Desktop.
List Roles for User
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-UserRoles{ | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory=$true, Position=0)] | |
[string]$Identity | |
) | |
$user = Get-User $Identity | |
return Get-Role -Filter * | Where-Object { $_.IsMember($user,$true,$true) } | |
} | |
Write-Host "Roles for ServicesAPI" -ForegroundColor Green | |
Get-UserRoles "sitecore\ServicesAPI" | |
Write-Host "Roles for Admin" -ForegroundColor Green | |
Get-UserRoles "sitecore\admin" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment