Advertisement
Guest User

Query Host

a guest
Nov 15th, 2012
662
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement