Zachary Loeber

I eat complexity and am never without a meal.

Determine if a computer is virtual with powershell

This function attempts to connect to a computer and find out if it is virtual or not using WMI. If it is virtual, a best guess at the type of virtual platform it is running upon is returned as well.


1.0.0 July 27th 2013

– Initial release


This is a pretty simple function I whipped together to have in my ever growing library. This script parses wmi for bios version and a few other bits of information in order to guess if it is running as a virtual machine. You can pass alternate credentials if needed. A few extra bits of information are returned just in case it is needed.


Download the script from the technet gallery (more frequently updated)

Download the script from this site (less frequently updated)