Re: ScriptText - ActiveScriptEventConsumer - Create
From: Sarika Sharma[MSFT] (sarikas_at_online.microsoft.com)
Date: 04/22/04
- Next message: Jiachuan Wang [MSFT]: "Re: Read a file from a remote computer - WMI"
- Previous message: Chris George: "Unable to retrieve data from SNMP via WQL"
- In reply to: Déborah: "Re: ScriptText - ActiveScriptEventConsumer - Create"
- Next in thread: Déborah: "Re: ScriptText - ActiveScriptEventConsumer - Create"
- Reply: Déborah: "Re: ScriptText - ActiveScriptEventConsumer - Create"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 22 Apr 2004 09:04:24 -0700
So let me understand
You are running w2k sp4 on the machine you are trying to create the process
(notepad interactively)
And this machine is local machine that is where you launch the script also.
The process gets created but is not interactive, can you check under what
useraccount is notepad running when launched by consumer using task manager
-- Sarika Sharma [MSFT] WMI Test Engineer This posting is provided "As Is" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm Please do not send e-mail directly to this alias. This alias is for newsgroup purposes only. "Déborah" <anonymous@discussions.microsoft.com> wrote in message news:51D91491-A806-4965-A8B9-298CFE9D9EFC@microsoft.com... > > Hi Sarika. Thanks for your comments. > > The script seems not to be interactive locally. > > When I execute this simple script under local machine, > > Dim objLocator_2, objReini, strComputer > strComputer = "." > Set objLocator_2 = CreateObject("WbemScripting.SwbemLocator") > Set objReini = objLocator_2.Connectserver(strComputer).Get("Win32_Process") > objReini.Create("Notepad.exe") > > it works fine. It creates an interactive process of notepad. > > But when I include it as the ScriptText of the consumer of a permanent event script, the process is created but it isn't interactive, although I run it under local machine > > I've read in http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/creating_processes_remotely.asp, that in Windows 2000 SP 2 and earlier: Win32_Process.Create can create an interactive process remotely. > > I have Windows 2000 SP4 and Execute Method and Remote Enable permissions, but the process created is not interactive. > > Do you know where can be the problem? > > Thank you very much. > > Greetings. Déborah > > Here's the text of the permanent event script: > > 'FILTER > > Dim objClsEventFilter > Dim objInstOfEventFilter > > Dim objLocator_1 > Set objLocator_1 = CreateObject ("WbemScripting.SwbemLocator") > Set objClsEventFilter = objLocator_1.ConnectServer(strComputer).Get("__EventFilter") > > Set objInstOfEventFilter = objClsEventFilter.SpawnInstance_() > > strWQL = "SELECT * FROM __InstanceDeletionEvent WITHIN 5 WHERE TargetInstance ISA 'Win32_Process' and TargetInstance.Name='Notepad.exe' " > objInstOfEventFilter.Properties_.Item("Name") = "Hola" > objInstOfEventFilter.Properties_.Item("Query") = strWQL > objInstOfEventFilter.Properties_.Item("QueryLanguage") = "WQL" > objInstOfEventFilter.Put_() > > 'CONSUMER > > Dim objClsActiveScriptEventConsumer > Dim objInstOfActiveScriptEventConsumer > > TextoScript = "Dim objLocator_2, objReini" & vbCrLf &_ > "Set objLocator_2 = CreateObject(""WbemScripting.SwbemLocator"")" & vbCrLf &_ > "Set objReini = objLocator_2.Connectserver(strComputer).Get(""Win32_Process"")" & vbCrLf &_ > "objReini.Create(""Notepad.exe"")" > > Dim objLocator_6 > Set objLocator_6 = CreateObject ("WbemScripting.SwbemLocator") > Set objClsActiveScriptEventConsumer = objLocator_6.ConnectServer(strComputer).Get("ActiveScriptEventConsumer") > > Set objInstOfActiveScriptEventConsumer = objClsActiveScriptEventConsumer.SpawnInstance_() > > objInstOfActiveScriptEventConsumer.Properties_.Item("Name")= "Adios" > objInstOfActiveScriptEventConsumer.Properties_.Item("ScriptText")= TextoScript > objInstOfActiveScriptEventConsumer.Properties_.Item("ScriptingEngine")= "VBScript" > > objInstOfActiveScriptEventConsumer.Put_() > > 'BINDING > > Dim objClsFilterToConsBinding > Dim objInstOfFilterToConsBinding > > Dim objLocator_3 > Set objLocator_3 = CreateObject ("WbemScripting.SwbemLocator") > Set objClsFilterToConsBinding = objLocator_3.ConnectServer(strComputer).Get("__FilterToConsumerBinding") > > Set objInstOfFilterToConsBinding = objClsFilterToConsBinding.SpawnInstance_() > > ruta="\root\cimv2:ActiveScriptEventConsumer.Name" > > objInstOfFilterToConsBinding.Properties_.Item("Consumer") = "\\" & strComputer & ruta & "=""Adios""" > objInstOfFilterToConsBinding.Properties_.Item("Filter") = "\\" & strComputer & "\root\cimv2:__EventFilter.Name=""Hola""" > objInstOfFilterToConsBinding.Properties_.Item("DeliverSynchronously") = FALSE > > objInstOfFilterToConsBinding.Put_() >
- Next message: Jiachuan Wang [MSFT]: "Re: Read a file from a remote computer - WMI"
- Previous message: Chris George: "Unable to retrieve data from SNMP via WQL"
- In reply to: Déborah: "Re: ScriptText - ActiveScriptEventConsumer - Create"
- Next in thread: Déborah: "Re: ScriptText - ActiveScriptEventConsumer - Create"
- Reply: Déborah: "Re: ScriptText - ActiveScriptEventConsumer - Create"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|