MSEndpointMgr / ConfigMgr

Microsoft Endpoint Configuration Manager scripts and tools
634 stars 281 forks source link

Not detecting VMWare machines #233

Closed KingDaveRa closed 4 years ago

KingDaveRa commented 4 years ago

Hi,

On the most recent version of the script I was trying to image a UEFI VM in VMWare 6.5. It failed with an error saying SystemSKU was null. Having inspected the script I've noticed that the SystemSKU in this case is returned as VMWare7,1. No idea why, I guess VMWare changed it. Modifying the script as follows on line 909 resolves it insomuch the script now fails properly as it doesn't run on VMs.

if ($ComputerSystemType -notin @("Virtual Machine", "VMware Virtual Platform", "VMWare7,1", "VirtualBox", "HVM domU", "KVM")) {

I've added basically the same WMI query to the TS to stop the script running on a VM, but this makes it fail better if the script is run on a VM.

NickolajA commented 4 years ago

Appreciated, this will be included in the new 4.0.0 version that's coming out shortly.