title: PowerShell command to check the connection between IPaddress and port in Windows Server 2008 R2
body: <p>I am working with PowerShell scripting on Windows Server 2012 R2. I was checking on the test connection of a machine with port. The following PowerShell command is working:</p>
  
  <pre><code>Test-NetConnection localhost -Port 445
  </code></pre>
  
  <p>This command along with <code>-InformationLevel</code> was returning either <code>TRUE</code> or <code>FALSE</code> depending on the result. This is exactly what I wanted.</p>
  
  <p>I need to run the same check on Windows Server 2008 R2. I understood that <code>Test-NetConnection</code> command will not work on Server 2008. I couldn't find any other commands to check the connection between machineIP and port and return whether <code>TRUE</code> or <code>FALSE</code>. Can anyone please suggest an alternative PowerShell command for this?</p>