Share via


TS Variable for VM

Question

Sunday, January 18, 2015 1:05 PM

Is there a built-in ts variable that I can use for virtual machine? I have a "run command line" step in in my TS wherein it will only execute if it is vm. By the way, we only have sccm 2012 r2 cu3 with no mdt integration

 

All replies (3)

Sunday, January 18, 2015 1:31 PM ✅Answered | 1 vote

There is no buildin task sequence variable in ConfigMgr, but it's relatively easy to determine if it's a VM. For the most common used virtual platforms you can use WMI like this:

  • Hyper-V: SELECT Model FROM Win32_ComputerSystem WHERE Model = "Virtual Machine";
  • VMware: SELECT Model FROM Win32_ComputerSystem WHERE Model = "VMware Virtual Platform";

My Blog: http://www.petervanderwoude.nl/
Follow me on twitter: pvanderwoude


Sunday, January 18, 2015 9:57 PM ✅Answered | 1 vote

Well... It depends on what you define as "built-in" :-)

SCCM and MDT is owned by the same team, and if you use SCCM with MDT, there is a built-in variable you can use:

IsVM  = False/True

But if you for some reason don't use MDT, Peter's WMI queries will work just fine too :-)

Ronni Pedersen | Microsoft MVP - ConfigMgr | Blogs: www.ronnipedersen.com/ and www.SCUG.dk/ | Twitter @ronnipedersen


Friday, September 1, 2017 9:39 AM

IsVM does not work with VMWare due to an MDT bug since 2013, see http://www.kraftkennedy.com/fix-ztigather-to-work-with-uefi-in-vmware-workstation/