Skip to content

Instantly share code, notes, and snippets.

@McAndersDK
Created January 13, 2020 10:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save McAndersDK/08c6b2615ff8638c03daa94e0f2df025 to your computer and use it in GitHub Desktop.
Save McAndersDK/08c6b2615ff8638c03daa94e0f2df025 to your computer and use it in GitHub Desktop.
Universal Dashboard Claim debug page
new-udpage -Url '/ClaimDebug' -Icon cogs -Id 'ClaimDebugPage' -Title 'Claim Debug' -Endpoint {
new-udcard -Title 'Authorization Policy' -Content {
New-UDElement -Tag ul -Attributes @{className="collection"} -Content {
Get-UDAuthorizationPolicy | ForEach-Object { New-UDElement -Attributes @{className="collection-item"} -Content {$_} -Tag 'li'}
}
}
New-UDCard -Title 'Claims' -Endpoint {
New-UDTable -Content {
New-Object -TypeName pscustomobject -Property @{
DisplayName = $ClaimsPrincipal.Claims | where-object Type -eq 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name' | select-object -First 1 -ExpandProperty value
SAM = $ClaimsPrincipal.Claims | where-object Type -eq 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier' | select-object -First 1 -ExpandProperty value
AuthType = $ClaimsPrincipal.Claims | where-object Type -eq 'http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationmethod' | select-object -First 1 -ExpandProperty value
Time = $ClaimsPrincipal.Claims | where-object Type -eq 'http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationinstant' | select-object -First 1 -ExpandProperty value
} | Out-UDTableData -Property DisplayName,SAM,AuthType,Time
} -Title 'Info' -Headers 'Display Name','SamAccountName','Auth Type','Auth Time'
New-UDTable -Content {
$ClaimsPrincipal.claims | where-object Type -eq http://schemas.xmlsoap.org/claims/Group | Out-UDTableData -Property value
} -Title 'Ad Groups' -Headers 'Group'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment