Test-ComputerName, verify ping and rdp connectivity for a computer

This function pings and opens a connection to the default RDP port to verify connectivity, futhermore it will check if a DNS entry exists and whether there is a computeraccount in Active Directory.

 
 
 
 
 
3.5 Star
(6)
7,902 times
Add to favorites
8/23/2013
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Nice!!
    1 Posts | Last post August 31, 2018
    • I've get all my servers with:
      get-adcomputer filter * -searchbase "my servers OU" -properties name | ft name | out-file c:\servers.txt -append
      
      So wrote this in Powershell ISE:
      
      $servers = get-content c:\servers.txt
      import-module C:\TestRDP.ps1
      foreach ($server in $servers) {
      Test-ComputerName -ComputerName $server
      }
      
      Very cool :-) Thanks
  • No output or errors
    2 Posts | Last post July 13, 2018
    • When I run this script I do not get any output or errors. Here's my PowerShell version info:
      
      PS C:\temp> $PSVersionTable.PSVersion
      
      Major  Minor  Build  Revision
      -----  -----  -----  --------
      3      0      -1     -1      
      
      I have tried running the script from 2 different servers with the same result.
      
      Please advise.
    • DaBombDotCom,
      
      I know this is a few years too late but to run this once you download the script you open PS as administrator and type the following;
      
      C:\> Test-ComputerName
      
      Which reports back something like;
      
      Name          :TestPC
      ADObject      :True
      DNSEntry      :True
      PingResponse  :True
      RDPConnection :True
      
      Clearly this is run against the local machine. To run remotely you would run the following;
      
      Test-ComputerName TESTREMOTEPC
      
      
      
      Hope this helps 
  • No output
    1 Posts | Last post December 06, 2016
    • I am seeing no output or results when the script is run (wether passing a live RDS server, or one that doesn't exist).  
  • Where would you add that?
    3 Posts | Last post August 24, 2016
    • Would you just add this at the end of the script?  I am still new and learning power-shell, with it pulling the list I want to put it at the beginning.
      
      Thank you
    • Hello John,
      
      Good to hear you are starting to learn PowerShell, good luck learning as it is a wonderful tool if used correctly. As for your question, the answer is not very satisfying: It depends.
      
      What kind of script are you working on, if for example you are trying to create a computer account in AD and you want to know if there is already a system with the same name then you would place this at the beginning of the script.
    • Hi Japp,
      Hope you are doing well.
      I am looking for script to test telnet IP and port through CSV file and email on only false result from CSV file.
      Could you please help me for this?
      
  • Can we give input as xls/csv file and get the output in xls using this script?
    2 Posts | Last post March 16, 2015
    • Can we give input as xls/csv file and get the output in xls using this script?
      I have more than 4000 servers to be checked,can I give server names as input and take output in xls file???
      Please update asap.
    • Yes this is possible using the ForEach-Object cmdlet in combination with Export-Csv. Here is an example of what you could use:
      
      Import-Csv YourFile.csv | ForEach-Object {
         .\Test-ComputerName.ps1 -ComputerName $_.ComputerName
      } | Export-Csv ComputerStatus.csv