Skip to content

Commit e701acd

Browse files
committed
Added Get-RpcSecurityPrincipalName
1 parent c48bbe2 commit e701acd

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

NtObjectManager/NtObjectManager.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ FunctionsToExport = 'Get-AccessibleAlpcPort', 'Set-NtTokenPrivilege',
133133
'Read-FwNetEvent', 'New-FwNetEventListener', 'Start-FwNetEventListener', 'Get-IPsecSaContext',
134134
'Get-FwEngineOption', 'Set-FwEngineOption', 'New-FwNetEventTemplate', 'Add-FwCondition',
135135
'Get-FwCallout', 'Add-RpcClientSecurityContext', 'Set-RpcClientSecurityContext',
136-
'Get-RpcClientSecurityContext'
136+
'Get-RpcClientSecurityContext', 'Get-RpcSecurityPrincipalName'
137137

138138
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
139139
CmdletsToExport = 'Add-NtKeyHive', 'Get-NtDirectory', 'Get-NtEvent', 'Get-NtFile',

NtObjectManager/RpcFunctions.ps1

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,4 +1484,29 @@ function Get-RpcClientSecurityContext {
14841484
$Client.Transport.SecurityContext | Where-Object ContextId -eq $ContextId
14851485
}
14861486
}
1487+
}
1488+
1489+
<#
1490+
.SYNOPSIS
1491+
Get the registered security principal name for a RPC server.
1492+
.DESCRIPTION
1493+
This cmdlet gets the registered security principal name for a RPC server.
1494+
.PARAMETER Binding
1495+
Specify the server binding.
1496+
.PARAMETER AuthenticationType
1497+
Specify the authentication type.
1498+
.INPUTS
1499+
None
1500+
.OUTPUTS
1501+
string
1502+
#>
1503+
function Get-RpcSecurityPrincipalName {
1504+
[CmdletBinding()]
1505+
Param(
1506+
[parameter(Mandatory, Position = 0)]
1507+
[string]$Binding,
1508+
[parameter(Mandatory, Position = 1)]
1509+
[NtApiDotNet.Win32.Rpc.Transport.RpcAuthenticationType]$AuthenticationType
1510+
)
1511+
[NtApiDotNet.Win32.Rpc.Transport.RpcTransportSecurity]::QueryServicePrincipalName($Binding, $AuthenticationType)
14871512
}

0 commit comments

Comments
 (0)