How to open a remote computer program through WMI.
I use WMI Win32_Process remote computer can successfully open Process,But failed to open a graphical interface that only shows running in the Process.
If the remote I run Notepad, how to open it? (Non-Process mode) Like manually open Notepad as open.
I am looking for some articles, some say that Windows permissions problem.
Code :
$Username = ""
$Password = ""
$Computer = ""
Func RemoteExecute($strProgToRun)
Local $objWMIService, $objProcess, $objProgram
$objSWbemLocator = ObjCreate("WbemScripting.SWbemLocator")
$objWMI = $objSWbemLocator.ConnectServer($Computer, "root\cimv2", $Username, $Password)
$objWMI.Security_.ImpersonationLevel = 3
$objProcess = $objWMI.Get("Win32_Process")
$objProgram = $objProcess.Methods_("Create").InParameters.SpawnInstance_
$objProgram.CommandLine = $strProgToRun
$objWMI.ExecMethod("Win32_Process", "Create", $objProgram)
EndFunc
Can be performed, but only in Process mode, can not see graphic.
Another psexec can start properly, no problem.