All,
I am using some code I found on the web to reset a VM on Hyper-V.
VBScript:
Set sService = GetObject("winmgmts:\\.\root\virtualization")
FWH:
oWinMgmt := CreateObject("winmgmts:\\.\root\virtualization")
oWinMgmt := GetActiveObject("winmgmts:\\.\root\virtualization")
oWinMgmt := Win_OleGetActiveObject("winmgmts:\\.\root\virtualization")
Also tried (based on a post from 2007):
oWinMgmt := CreateObject("winmgmts:")
Everything I have tried:
Valtype( oWinMgmt ) == "U"
I am running this on the Server that hosts the VM systems.
I can run a powershell command and get this accomplished:
Reset-VM -Name "Windows 10_04_New" -Force
Anyone familiar with this?
Thanks,
Byron ...
Trouble with GetObject / CreateObject
-
- Posts: 388
- Joined: Sun Nov 06, 2005 3:55 pm
- Location: Southern California, USA
- Contact:
- Antonio Linares
- Site Admin
- Posts: 42516
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 75 times
- Contact:
Re: Trouble with GetObject / CreateObject
have you tried:
hb_Run( "Reset-VM -Name "Windows 10_04_New" -Force" )
hb_Run( "Reset-VM -Name "Windows 10_04_New" -Force" )