Skip to content

Instantly share code, notes, and snippets.

@Laim
Created April 22, 2020 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Laim/2ce36493c8cb1e5acb374dd6800eecd0 to your computer and use it in GitHub Desktop.
Save Laim/2ce36493c8cb1e5acb374dd6800eecd0 to your computer and use it in GitHub Desktop.
machinetype
strName = "." 'Computer name, if local just use a period.
Set objWMI = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strName & "\root\cimv2")
For Each obj in objWMI.ExecQuery ("Select * from Win32_SystemEnclosure")
For Each strChassisType in obj.ChassisTypes
Wscript.Echo strChassisType
Next
Next
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment