AJ82 Posted September 18, 2013 Report post Posted September 18, 2013 Hi All, I have a perfectly working TS for deploying OSD on physical machines. What I am trying to achieve is to use the same TS and branch out if the condition is true: IsVM equal to TRUE or a WMI query: http://social.technet.microsoft.com/Forums/systemcenter/en-US/d10c3e05-c211-45a6-859e-8c1ca2936430/vmware-tools-how-to-detect-a-virtual-machine I have tried both the options but they do not work, please let me know if I am making a mistake. Using: SCCM 2007 R3 Windows 7 deployment on a VMware platform. Virtual machine will be created using HW template using vCenter (which I don not care about). Quote Share this post Link to post Share on other sites More sharing options...
Canada Jack Posted September 18, 2013 Report post Posted September 18, 2013 Here is the code that you can use to find whether your server is Physical orVMWare box. This code uses Win32_ComputerSystem WMI class to query forManufacturer property. On Physical servers, this property will give you thename of real manufacturer. While, on Virtual servers, it will give you"VMWare Inc." for VMWare boxes.'----------------------------------------------------------------------------strComputer = "."wscript.echo getMachineType(strComputer)function GetMachineType(strComputer)Set objWMIService = GetObject("winmgmts:" _& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")Set colSettings = objWMIService.ExecQuery _("Select * from Win32_ComputerSystem")For Each objComputer in colSettingsstrType = objComputer.ManufacturerNextif lcase(left(strType,6))="vmware" thenGetMachineType="V" 'Virtual VMWare Box.elseGetMachineType="P" 'Physical Machineend ifend function'------------------------------------------------------------------------- Quote Share this post Link to post Share on other sites More sharing options...
AJ82 Posted September 19, 2013 Report post Posted September 19, 2013 Thanks, that worked well. Quote Share this post Link to post Share on other sites More sharing options...