The New-DfsSpnAuditPlan command is used by DFS administrators to identify potential issues with Service Principal Names (SPNs) associated with a DFS namespace server’s machine account. This command helps prevent common pitfalls such as duplicate SPNs or incorrect registrations.
Using this command can help reduce the risk of:
- Inconsistent SPN registrations across multiple systems
- Errors in DNS propagation and registration of new services
- Compliance issues related to accurate and unique SPN usage
A manager would care about this command if they are responsible for ensuring their organization’s DFS infrastructure is secure, scalable, and compliant with relevant policies.
To use the New-DfsSpnAuditPlan command:
- Run
Get-DfsSpnCandidateto obtain a list of expected SPNs. - Pipe the output of
Get-DfsSpnCandidateintoNew-DfsSpnAuditPlan. - Review the resulting report to identify any missing or orphaned SPNs.
Example Code:
$expectedSpns = Get-DfsSpnCandidate -TargetComputer "example-namespace"
$result = $expectedSpns | New-DfsSpnAuditPlan
# Output the result to a file for later review
$result | Export-Csv -Path "C:\Reports\SPN-Audit-Report.csv" -NoTypeInformationWatchpoints:
- Make sure to run this command after any changes to your DFS infrastructure, such as new service additions or namespace modifications.
- Use the
-Verboseswitch for more detailed output and easier debugging.
The New-DfsSpnAuditPlan command is used to identify discrepancies between expected and actual SPNs associated with a DFS namespace server’s machine account. In simple terms:
- Get the list of expected SPNs using
Get-DfsSpnCandidate. - Run
New-DfsSpnAuditPlanon the list of expected SPNs. - Review the report to identify any missing or orphaned SPNs.
Step-by-Step Recipe:
- Open PowerShell and navigate to the module’s directory.
- Run
Import-Module SpnManager. - Use
Get-DfsSpnCandidateto obtain a list of expected SPNs. - Pipe the output into
New-DfsSpnAuditPlan. - Review the resulting report.
When Stuck:
- Check your DFS infrastructure for any recent changes or updates that might affect SPN registration.
- Consult the module’s documentation and online resources for troubleshooting tips.
- Reach out to your organization’s IT support team if you need further assistance.
| 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.DFS |
| 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. |
This command follows industry best practices for data handling and transit:
- Data in Transit: All output is transmitted securely using SSL/TLS.
- Data at Rest: Output files are stored on a secure, approved storage location.
- Audit Trail: The module logs all actions taken by
New-DfsSpnAuditPlan, including input parameters and results.
Note: This command does not directly handle sensitive data such as passwords or secret keys. Any required authentication is performed securely using established protocols.
This is the plan step. It turns a candidate into a plan showing what is missing; nothing is changed. Its output is normally piped into Test-SpnAuditPlan. Providers: AD.DFS.
Example 1
Get-DfsSpnCandidate -TargetComputer 'dfsns01.corp.example.com' | New-DfsSpnAuditPlanAlso uses: Get-DfsSpnCandidate (Sense).
Example 2
New-DfsSpnAuditPlan -Candidate $candidateExample 3
Get-DfsSpnCandidate -TargetComputer 'srv01' | New-DfsSpnAuditPlan | Test-SpnAuditPlanAlso uses: Get-DfsSpnCandidate (Sense), Test-SpnAuditPlan (Test).