How to determine if a server is virtual or physical

$servernames = Get-Content C:\kb4493472.txt
foreach($servername in $servernames){
    if (test-connection $servername -count 1 -quiet){
     $s = Invoke-Command $servername -scriptblock{ Get-WmiObject win32_computersystem | select name, model
      }
     $s | Out-File C:\kb4493472-toUpdate.txt -Append
    }
}

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *