Skip to content

Commit 00185e3

Browse files
author
James Forshaw
committed
Added switch to show all tokens.
1 parent f6822ab commit 00185e3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

NtObjectManager/NtObjectManager.psm1

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1243,6 +1243,9 @@ Display the primary tokens from accessible processes named notepad.exe.
12431243
.EXAMPLE
12441244
Show-NtToken -Name "notepad.exe" -MaxTokens 5
12451245
Display up to 5 primary tokens from accessible processes named notepad.exe.
1246+
.EXAMPLE
1247+
Show-NtToken -All
1248+
Show a list of all accessible tokens to choose from.
12461249
#>
12471250
function Show-NtToken {
12481251
[CmdletBinding(DefaultParameterSetName = "FromPid")]
@@ -1256,7 +1259,9 @@ function Show-NtToken {
12561259
[Parameter(Mandatory=$true, Position=0, ParameterSetName="FromName")]
12571260
[string]$Name,
12581261
[Parameter(Position=0, ParameterSetName="FromName")]
1259-
[int]$MaxTokens = 0
1262+
[int]$MaxTokens = 0,
1263+
[Parameter(Position=0, ParameterSetName="All")]
1264+
[switch]$All
12601265
)
12611266

12621267
PROCESS {
@@ -1292,6 +1297,9 @@ function Show-NtToken {
12921297
Start-NtTokenViewer $t
12931298
}
12941299
}
1300+
"All" {
1301+
Start-Process "$PSScriptRoot\TokenViewer.exe"
1302+
}
12951303
}
12961304
}
12971305
}

0 commit comments

Comments
 (0)