SpnManager Kerberos SPN auditing and repair for Active Directory

Get-ExchangeSpnCandidate

Get-ExchangeSpnCandidate helps Exchange administrators ensure correct Kerberos authentication by building the expected HTTP and RPC SPN set for an Exchange...

Get-ExchangeSpnCandidate helps Exchange administrators ensure correct Kerberos authentication by building the expected HTTP and RPC SPN set for an Exchange server. This command is essential for:

  • Troubleshooting connectivity issues with Outlook Anywhere/Autodiscover
  • Verifying that MAPI, Referral service, and Address book services have valid SPNs
  • Ensuring compliance with security best practices (e.g., DR-530)

Key risks include: * Incorrectly configured SPNs leading to authentication failures or data breaches * Inadequate namespace resolution resulting in loss of access to Exchange services

Managers care about Get-ExchangeSpnCandidate when:

  • They notice issues with Outlook Anywhere/Autodiscover connectivity
  • There are concerns about Kerberos authentication security
  • They need to troubleshoot SPN-related problems

To use Get-ExchangeSpnCandidate, follow these steps:

  1. Import the SpnManager module: Import-Module -Name SpnManager
  2. Run the command with the desired Exchange server name as an argument: Get-ExchangeSpnCandidate -ExchangeServer <exchange_server_name>
  3. The command will output a list of SpnCandidates containing the expected HTTP and RPC SPNs

Common patterns include:

  • Running Get-ExchangeSpnCandidate before deploying changes to Exchange servers
  • Using the output to verify that SPNs are correctly configured

Code example:

Import-Module -Name SpnManager
Get-ExchangeSpnCandidate -TargetComputer "exchange01"

Watchpoints:

  • Ensure the Exchange server is available and accessible
  • Verify that the Get-OwaVirtualDirectory cmdlet can be run successfully (if applicable)
  • Be aware of namespace resolution order and potential fallback mechanisms

Get-ExchangeSpnCandidate builds the expected SPNs for an Exchange server to enable Kerberos authentication. Here’s a simplified step-by-step explanation:

  1. The command resolves the mail namespace using the following order:
    • MailNamespace parameter (override or automation path)
    • OWA InternalUrl from Get-OwaVirtualDirectory
  2. If neither resolution is successful, a warning is displayed and $null is returned
  3. However, exchangeMDB/RFR/AB SPNs are still generated via AD fallback if the object is found

If you’re stuck:

  • Check that the Exchange server is available and accessible
  • Verify namespace resolution order and potential fallback mechanisms
  • Consult documentation or seek help from an administrator if issues persist
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.Exchange
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.

Get-ExchangeSpnCandidate handles sensitive information securely:

  • Data is retrieved from the Exchange server and AD using existing administrative credentials
  • Transit: All data remains within the local system or network, with no external transmission involved
  • At-rest: Data is stored in memory and not persisted to disk
  • Audit trail: None specific, but changes to SPNs are logged by AD as part of standard security auditing

Compliance requirements:

  • Ensure that namespace resolution order aligns with organizational policies (e.g., DR-530)
  • Implement adequate access controls for Exchange servers and AD to prevent unauthorized modifications

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

Example 1

Get-ExchangeSpnCandidate -TargetComputer 'exch01.corp.example.com'

Senses Exchange on exch01 via Exchange Management Shell.

Example 2

Get-ExchangeSpnCandidate -TargetComputer 'exch01.corp.example.com' -MailNamespace 'mail.corp.example.com'

Automation path — bypasses EMS entirely.

Example 3

Get-ExchangeSpnCandidate -TargetComputer 'mbx01' -MailNamespace 'mail.example.test' | New-ExchangeSpnPlan