What is Netdiag.exe?
Netdiag.exe is a Windows 2000 and 2003 Server command line tool that can be used to effectively test the network connectivity of a computer, and provides valuable insight to the overall health of your network. Netdiag can help you solve any number of network issues including:
- Checking Virtual Private Networks (VPN) network tunnels
- Domain Name Service (DNS) or Windows Internet Naming Service (WINS) name resolution problems
- Active directory replication
- Verifying the binding of a server’s network cards
- Problems with Internet Protocol Security (IPSEC)
- Winsock corruption
- Verifying the ability of domain controllers to use Lightweight Directory Access Protocol (LDAP)
Installing Netdiag.exe
Netdiag is included as part of the Support Tools on the Windows Server CD. Once the Support Tools have been installed you can simply run ‘netdiag.exe’ from a command line.
Using Netdiage.exe
Properly using netdiag involves a number of command line switches that need to be entered in a certain order. Not all of the switches are required, but the correct full syntax if you were to use them all is as follows:
netdiag [/q] [/v] [/l] [/debug] [/d:domain_name] [/fix] [/dcaccountenum] [/test:test_name] [/skip:test_name]
Below are the definitions of the various parameters:
- /q: Specifies quite output and only displays errors
- /v:Runs Netdiag in verbose mode, which dispays each action as it is being performed
- /l:Sends the output of the Netdiag results to a Netdiag.log file
- /debug:Runs Netdiag in debug mode
- /d:domain_name: Used to locate domain controllers in a specified domain
- /fix:This parameter detects and correct issues with DNS. It verifies that all DNS entries contained on a server are correct, and updates any invalid entries.
- /dcaccountenum: Enumerates the computer accounts of the domain controller
- /test:test_name:This parameter can be used to specify form a long list of netdiag tests that you can run. test_name can be any of the following values:
Autonet: Automatic Private IP Addressing (APIPA) address test
Bindings: Bindings test
Browser: Redir and Browser test
DcList: Domain controller list test
DefGw: Default gateway test
DNS: Domain Name Service (DNS) test
DsGetDc: Domain controller discovery test
IpConfig: IP address configuration test
IpLoopBk: IP address loopback ping test
IPSec: Internet Protocol security (IPSec) security test
IPX: Internetwork Packet Exchange (IPX) test
Kerberos: Kerberos Test
Ldap: Lightweight Directory Access Protocol (LDAP) test
Member: Domain membership test
Modem: Modem diagnostics test
NbtNm: NetBIOS over TCP/IP (NetBT) name test
Ndis: Netcard queries test
NetBTTransports: NetBT transports test
Netstat: Netstat information test
NetWare: NetWare test
Route: Routing table test
Trust: Trust relationship test
WAN: Wide Area Network (WAN) configuration test
WINS: Windows Internet Naming Services (WINS) service test
Winsock: Winsock test
You can specifiy multiple tests by using multiple instances of the /test:test_namecommand, each separated with a space. So, for example, if you wanted to run three tests: DNS, IPSec, and WINS, a typical Netdiag command line would look like this:
netdiag /v /dcaccountenum /test:DNS /test:IPSec /test:WINS
- /skip:test_name:Allows you specify one or more of the above tests that you want to skip during a particular Netdiag session. As with /test:test_name, you can specify multiple tests to skip by using multiple instances of the /skip:test_name command, each separated with a space.
Even in today’s point-and-click world, there are still a huge number of effective and powerful command line tools available for troubleshooting and monitoring. Netdiag is just one of many, but it is most certainly useful when examining your Windows Server infrastructure.

