Skip to main content

Get-DCDiagReport

Description

This is an advanced version of DCDiag. It offers all the options available with the dcdiag application, along with some minor enhancements and changes. DCDiag can output a TXT log file, export to XLS or XML, or return an object. This script can export to CSV, XML, HTML, JSON, and TXT, as well as return an object if desired.

Requirements

Must be run on a domain controller.

.\Get-DCDiagReport.ps1 [ [-n <NamingContext> -Skip <TestName>,<TestName>,...] | [-test <TestName>,<TestName>,...] | [-c -Skip <TestName>,<TestName>,...] ] [-a] [-i] [-e] [q] [s] [-Fix] [-BaseName <LogFileName> [-ReportPath <System.IO.Directory>] [-CSV -XML -HTML -JSON ]]

Parameters

ParameterAliasRequiredDefaultTypeDescription
NamingContextnFalseStringSpecify target domains in NetBIOS, Domain Name System (DNS), or distinguished name format.
AllSiteServersaFalseSwitchTarget all servers in the current site.
AllEnterpriseServerseFalseSwitchTarget all servers in the enterprise.
IgnoreiFalseSwitchIgnore all superfluous error messages.
QuietqFalseSwitchSuppress all non-error console output.
ComprehensivecFalseSwitchRuns all tests except DCPromo and RegisterInDNS, including non-default tests.
FixFalseSwitchFix the Service Principal Names (SPNs) on the Machine Account object of the domain controller.
BaseNameTrue for export parameter set names(hostname)-dcdiagStringSets the Basename of any created report file.
ReportPathFalseScript parent directorySystem.IO.DirectorySets the path to export the report to. Defaults to the current script working directory.
CSVFalseSwitchDesignates a report file type of .CSV.
XMLFalseSwitchDesignates a report file type of .XML.
HTMLFalseSwitchDesignates a report file type of .HTML.
JSONFalseSwitchDesignates a report file type of .JSON.
TestSemiString[]Run specific tests.
SkipSemiString[]Run all tests except specific tests.

Output

.\Get-DCDiagReport-log.txt
.\Get-DCDiagReport-error.txt
<Specified Log File Path and fileName>