Checking network connectivity
One of the first things you can do in terms of troubleshooting is to determine whether you have network connectivity between your hosts.
Getting ready
This recipe uses servers in the Reskit.Org
domain (DC1
, DC2
, SRV1
, and SRV2)
that you have previously installed. Run this recipe on SRV1
.
How to do it...
- Use
Test-Connection
to test the connection toDC1
:Test-Connection -ComputerName DC1
- Redo the test with a simple true/false return:
Test-Connection -ComputerName DC1 -Quiet
- Test multiple systems at once:
Test-Connection -ComputerName 'DC1','DC2','SRV2' -Count 1
- Test the connectivity for
SMB
traffic withDC1
:Test-NetConnection -ComputerName DC1 -CommonTCPPort SMB
- Get a detailed connectivity check by using
DC1
with HTTP:$TNCHT ...
Get Windows Server 2019 Automation with PowerShell Cookbook - Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.