{"id":1670,"date":"2011-12-23T17:35:48","date_gmt":"2011-12-23T16:35:48","guid":{"rendered":"http:\/\/www.mariotti.de\/?p=1670"},"modified":"2011-12-23T17:35:48","modified_gmt":"2011-12-23T16:35:48","slug":"remote-prozes-mit-wmi-starten","status":"publish","type":"post","link":"https:\/\/dev.mariotti.de\/?p=1670","title":{"rendered":"Remote Prozes mit WMI starten"},"content":{"rendered":"<pre>Das folgende Beispiel zeigt wie man auf einem entferntem System Prozesse mittels VB Script und WMI ausf\u00fchrt.<\/pre>\n<pre><code class=\"language-cs\">'Execute remote process\nstrComputer =\"YourComputer\"\nstrDomain = \"YourDomain\"\nstrUser = \"YourUser\"\nstrPassword = \"YourPassword\"\nstrCMDLine = \"C:\\Windows\\Notepad.exe C:\\Boot.ini\"\nstrCMDDir = \"C:\\Windows\"Set\nobjSWbemLocator = CreateObject(\"WbemScripting.SWbemLocator\")\nSet objWMIService = objSWbemLocator.ConnectServer(strComputer,\"root\\CIMV2\",strUser,strPassword,\"MS_409\",\"ntlmdomain:\" + strDomain)\nSet objShare = objWMIService.Get(\"Win32_Process\")\nSet objInParam = objShare.Methods_(\"Create\").inParameters.SpawnInstance_()\nobjInParam.Properties_.Item(\"CommandLine\") = \"C:\\Windows\\Notepad.exe C:\\Boot.ini\"\nobjInParam.Properties_.Item(\"CurrentDirectory\") = \"C:\\Windows\"\nSet objOutParams = objWMIService.ExecMethod(\"Win32_Process\", \"Create\", objInParam)\nWscript.echo \"ProcessId: \" &amp; objOutParams.ProcessId\nWscript.echo \"ReturnValue: \" &amp; objOutParams.ReturnValue<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In diesem Artikel zeige wie ich man Remote Prozesse per WMI starten kann<\/p>\n","protected":false},"author":2,"featured_media":2314,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-1670","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-windows"],"_links":{"self":[{"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/posts\/1670","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1670"}],"version-history":[{"count":0,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/posts\/1670\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/media\/2314"}],"wp:attachment":[{"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1670"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1670"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}