Skip to content

Instantly share code, notes, and snippets.

@natesubra
Created October 12, 2021 00:11
Show Gist options
  • Save natesubra/49c71cafba9d3b0517071b352de549ed to your computer and use it in GitHub Desktop.
Save natesubra/49c71cafba9d3b0517071b352de549ed to your computer and use it in GitHub Desktop.
Get SID Mappings Powershell
$tableLayout = (
@{Expression = { ((New-Object System.Security.Principal.SecurityIdentifier($_.Value)).Translate([System.Security.Principal.NTAccount])).Value }; Label = "Name"; Width = 40 },
@{Expression = { $_.Value }; Label = "SID"; Width = 40 },
@{Expression = { $_.Type }; Label = "Type" }
)
$Claims = ([Security.Principal.WindowsIdentity]::GetCurrent()).Claims
$Claims | Format-Table $tableLayout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment