Test Range of IPs and resolve DNS Name


posted by byterebel
07-13-2010

Downloads: 494
File size: 532 B
Views: 2,328

Embed
Test Range of IPs and resolve DNS Name
  1. ## ***************************** 
  2. ## TestRange by ByteRebel 
  3. ## 13.07.2010 
  4. ## ***************************** 
  5. ## Test-Connection a range of IPs and resolve DNS Name when sucessfull 
  6. ## you must give the script 3 Arguments 
  7. ## Example: 
  8. ## TestRange.ps1 9 50 54 
  9. ## This would test the Range 10.155.9.50 to 10.155.9.54 
  10.  
  11. $bereich = $args[0] 
  12. $args[1]..$args[2] | foreach-object {if (test-connection -computername  10.155.$bereich.$_ -count 1 -quiet) {[net.dns]::gethostbyaddress("10.155.$bereich.$_")}} | select hostname,addresslist 
Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.