Want more features on Pastebin? Sign Up, it's FREE!
Guest

Query Host

By: a guest on Nov 15th, 2012  |  syntax: Power Shell  |  size: 0.53 KB  |  views: 455  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. param([string]$computer)
  2. if ($computer -eq ""){$computer = read-host "Enter hostname or IP"}
  3.  
  4. Clear
  5.  
  6. Write-Host "System Info:"
  7. Write-Host "------------------------"
  8. Gwmi Win32_ComputerSystem -Comp $computer | fl Domain, Manufacturer, Model, Name, UserName, Status
  9. $colItems = GWMI -cl "Win32_NetworkAdapterConfiguration" -name "root\CimV2" `
  10. -comp $computer -filter "IpEnabled = TRUE"
  11.  
  12. ForEach ($objItem in $colItems){
  13. Write-Host "MAC Address: " $objItem.MacAddress
  14. Write-Host "IP Address: " $objItem.IpAddress}
  15. Write-Host ""
clone this paste RAW Paste Data