File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1095,6 +1095,8 @@ Show integrity information.
10951095Show token security attributes.
10961096. PARAMETER TrustLevel
10971097Show token trust level.
1098+ . PARAMETER Information
1099+ Show token information such as type, impersonation level and ID.
10981100. OUTPUTS
10991101Text data
11001102. EXAMPLE
@@ -1117,7 +1119,8 @@ function Format-NtToken {
11171119 [switch ]$User ,
11181120 [switch ]$Integrity ,
11191121 [switch ]$SecurityAttributes ,
1120- [switch ]$TrustLevel
1122+ [switch ]$TrustLevel ,
1123+ [switch ]$Information
11211124 )
11221125
11231126 if ($All ) {
@@ -1127,11 +1130,12 @@ function Format-NtToken {
11271130 $Integrity = $true
11281131 $SecurityAttributes = $true
11291132 $TrustLevel = $true
1133+ $Information = $true
11301134 }
11311135
11321136 if (! $User -and ! $Group -and ! $Privilege `
11331137 -and ! $Integrity -and ! $TrustLevel `
1134- -and ! $SecurityAttributes ) {
1138+ -and ! $SecurityAttributes -and ! $Information ) {
11351139 $token.User.ToString ()
11361140 return
11371141 }
@@ -1194,6 +1198,18 @@ function Format-NtToken {
11941198 " -------------------"
11951199 $token.SecurityAttributes | Format-Table
11961200 }
1201+
1202+ if ($Information ) {
1203+ " TOKEN INFORMATION"
1204+ " -----------------"
1205+ " Type : {0}" -f $token.TokenType
1206+ if ($token.TokenType -eq " Impersonation" ) {
1207+ " Imp Level : {0}" -f $token.TokenType
1208+ }
1209+ " ID : {0}" -f $token.Id
1210+ " Auth ID : {0}" -f $token.AuthenticationId
1211+ " Session ID: {0}" -f $token.SessionId
1212+ }
11971213}
11981214
11991215<#
You can’t perform that action at this time.
0 commit comments