densaface
13 years agoNew Contributor
How restart remote computer by WMI
I'm using a license TestComplete 7.52... Script on Delphi:
Locator := Sys.OleObject ('WbemScripting.SWbemLocator');
Locator.Security_.ImpersonationLevel := 3;
WmiService := Locator.ConnectServer (Server, 'root\cimv2', 'Administrator', '1q2w3eQAZ');
NewJob := WmiService.Get('Win32_OperatingSystem');
NewJob.Win32Shutdown(2); // this is error "SWbemObjectEx Invalid method Parameter(s)"
Why is invalid? How to write correctly
Locator := Sys.OleObject ('WbemScripting.SWbemLocator');
Locator.Security_.ImpersonationLevel := 3;
WmiService := Locator.ConnectServer (Server, 'root\cimv2', 'Administrator', '1q2w3eQAZ');
NewJob := WmiService.Get('Win32_OperatingSystem');
NewJob.Win32Shutdown(2); // this is error "SWbemObjectEx Invalid method Parameter(s)"
Why is invalid? How to write correctly