On an internal mailing list someone asked how to get the SID for the current context using PowerShell. Chris Bellée correctly responded:
([Security.Principal.WindowsIdentity]::GetCurrent()).user.accountdomainsid.value
([Security.Principal.WindowsIdentity]::GetCurrent()).user.accountdomainsid.value
I used this to create a script: Get-Me.ps1
# Get-Me.ps1
[Security.Principal.WindowsIdentity]::GetCurrent()
PS> .get-me.ps1
AuthenticationType : NTLM ImpersonationLevel… Read the full text.