SpnManager Kerberos SPN auditing and repair for Active Directory

Get-RdpSpnCandidate

Get-RdpSpnCandidate is used by IT administrators to ensure the TERMSRV SPNs for Remote Desktop Services are correctly configured on a target machine. This...

Get-RdpSpnCandidate is used by IT administrators to ensure the TERMSRV SPNs for Remote Desktop Services are correctly configured on a target machine. This module helps prevent issues with remote desktop connectivity.

  • Risks: Incorrectly configured TERMSRV SPNs can lead to authentication failures and impact productivity.
  • When a manager cares:
    • During initial setup of Remote Desktop Services
    • After changes to the target machine’s name or IP address
    • Before scaling out Remote Desktop Services across multiple machines

Usage Scenario: Verifying TERMSRV SPNs

  1. Import the SpnManager module and connect to Active Directory using a suitable cmdlet (e.g., Connect-AD).
  2. Run Get-RdpSpnCandidate <target_machine_name> to retrieve one SpnCandidate for the target machine account.
  3. Pass this candidate to New-RdpSpnAuditPlan for auditing.
  4. Review and address any discrepancies found by the audit plan.
# Example usage
Import-Module -Name SpnManager
$splClient = Connect-SpnClient -Server 'https://example.com'
$candidate = Get-RdpSpnCandidate -TargetComputer 'target_machine'
$newAuditPlan = New-RdpSpnAuditPlan -Candidate @($candidate)

Watchpoint: Ensure the target machine’s account exists in Active Directory and has a valid UPN.

What it Does

Get-RdpSpnCandidate builds the expected TERMSRV SPNs for a target machine. These are used to ensure Remote Desktop Services work correctly.

  1. Run Get-RdpSpnCandidate with the target machine’s name.
  2. This cmdlet will return one SpnCandidate describing the two TERMSRV SPNs (FQDN and NetBIOS variants).
  3. Pass this candidate to New-RdpSpnAuditPlan for auditing.

When You’re Stuck

  • Check that the target machine account exists in Active Directory with a valid UPN.
  • Verify the module is correctly imported and connected to Active Directory.
  • Review the audit plan generated by New-RdpSpnAuditPlan.
Field Value
Vendor Detent Point LLC
Product SpnManager 0.4.0
Licence Proprietary - licensed, not sold. See LICENSE.
Operational impact Read-only. Queries Active Directory and reports findings; changes nothing.
Rights required Directory read access. Some providers additionally need rights to read delegation and encryption-type attributes.
Providers covered AD.RDP
Approval recommendation Approve for general operational use. It cannot alter directory state.

Licence terms are proprietary and are supplied with the purchase, subscription or evaluation agreement. No open-source licence is granted.

What Why
Windows PowerShell 5.1 or later Declared by the module manifest.
ActiveDirectory 1.0.0.0 Required module. Ships with RSAT; install the Active Directory PowerShell feature.
A reachable domain controller Every provider reads from Active Directory.
An account with directory read access Needed to enumerate accounts and their SPNs.
  • Data handling: This cmdlet does not manipulate or modify Active Directory data.
  • Transit: No sensitive data is transmitted by this cmdlet.
  • At rest: TERMSRV SPNs are stored in the target machine’s account in Active Directory.
  • Audit trail: Use New-RdpSpnAuditPlan to generate an audit plan and track discrepancies over time.

This is the sense step. It reads the current state and produces a candidate; nothing is changed. Its output is normally piped into New-RdpSpnAuditPlan. Providers: AD.RDP.

Example 1

Get-RdpSpnCandidate -TargetComputer 'srv01'

Example 2

Get-RdpSpnCandidate

Audits the local machine.

Example 3

Get-RdpSpnCandidate -TargetComputer 'rds01' | New-RdpSpnAuditPlan

Also uses: New-RdpSpnAuditPlan (Plan).