hi there,

I am having trouble getting this script to popup notepad on the remote XP
screen, it will start the Notepad.exe process but will not make the window
visible. can anyone help?

Thanks

Const WINDOW_STATE = 5
strComputer = "RemoteMachineName"

Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\"
& strComputer & "\root\cimv2")
Set objStartup = objWMIService.Get("Win32_ProcessStartup")
Set objConfig = objStartup.SpawnInstance_
objConfig.ShowWindow = WINDOW_STATE
Set objProcess = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
strComputer & "\root\cimv2:Win32_Process")
errReturn = objProcess.Create("Notepad.exe", null, objConfig, intProcessID)

RE: Execute Remote Process visible by v-phuang

v-phuang
Wed May 25 03:14:04 CDT 2005

Hi

Here is a link for your reference.
http://groups.google.co.jp/group/microsoft.public.scripting.wsh/browse_threa
d/thread/af42a9f3fee2caa8/84243450b722249e?q=create+remote+process+wmi+inter
active&rnum=1&hl=zh-CN#84243450b722249e

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.


RE: Execute Remote Process visible by v-kevy

v-kevy
Thu May 26 02:29:48 CDT 2005

Hi Devron,

As mentioned in the link that Peter has posted, this cannot be done in any
Windows version after Windows 2000 sp3 because of security reason.

You can try the tool provided in that thread.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Re: Execute Remote Process visible by Torgeir

Torgeir
Thu May 26 11:46:11 CDT 2005

Devron Blatchford wrote:

> this script to popup notepad on the remote XP
> screen, it will start the Notepad.exe process but will not make the window
> visible. can anyone help?
>
> Thanks
>
> Const WINDOW_STATE = 5
> strComputer = "RemoteMachineName"
>
> Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\"
> & strComputer & "\root\cimv2")
> Set objStartup = objWMIService.Get("Win32_ProcessStartup")
> Set objConfig = objStartup.SpawnInstance_
> objConfig.ShowWindow = WINDOW_STATE
> Set objProcess = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
> strComputer & "\root\cimv2:Win32_Process")
> errReturn = objProcess.Create("Notepad.exe", null, objConfig, intProcessID)
Hi,

Sorry, that is not possible with the Win32_Process.Create method...


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

Re: Execute Remote Process visible by Manfred

Manfred
Thu May 26 16:56:23 CDT 2005

Hi All,

that not very easy, but IT IS POSSIBLE at all, ok, not for the faint of
heart ;-)
I posted the answer several times and I'll try to recap the necessary steps.

1) Create a COM component in scripting
this is a file with extension *.wsc
Write a simple class, which automates Internet Explorer
[using Set objIE = CreateObject("InternetExplorer.Application")]
and provide in minimum a simple method to output a string to IE with
a method
of this class; It is out of my scope to provide an implementation
here.

2) Create a second script, which instantiates the component from 1)
and write some output to IE, just to see, that this works.

3) Go to "Component Management Console" and create a new
empty Library Application.
Import the component, created in 1)
Configure this application to run under the authority of
the interactive user [this is the most importent step at all]
Export the complete application, this will create a MSI file.

4) Install that MSI file on the "remote computer", which should later
display the messages. It is also possible to install remotely
using WMI, so no turn-pikes are necessary ;-)

5) Copy the test-script, used in step 2) to the remote machine.

6) Create a [remote] process on the target machine, which
uses the script from step 2) as a local resource.

That all is not very easy and requires some work, but it does the trick.

One has to take into account - in script from step 2) - that, if there
is no user logged on on the remote box, the instantiation of the component
fails. The importent thing to understand is, that COM manages the
impersonation from the process/thread, running the script via WMI as the
remote user, to the local interactively logged in user.

I am not too sure about how secure this solution is. I THINK, there is not
a big problem, because there is no way from the running IE/component back
to the script executed by an remote admin. And naturally, this should not
be coded inside the component!

Hope, this helps. I am sorry, I cannot provide the complete infrastructure
for this.

Best regards,
Manfred Braun

(Private)
Mannheim
Germany

mailto:_manfred.braun_@manfbraun.de
(Remove the anti-spam-underscore to mail me!)


"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:%23J5Q$KhYFHA.2756@tk2msftngp13.phx.gbl...
> Devron Blatchford wrote:
>
> > this script to popup notepad on the remote XP
> > screen, it will start the Notepad.exe process but will not make the
window
> > visible. can anyone help?
> >
> > Thanks
> >
> > Const WINDOW_STATE = 5
> > strComputer = "RemoteMachineName"
> >
> > Set objWMIService =
GetObject("winmgmts:{impersonationLevel=impersonate}!\\"
> > & strComputer & "\root\cimv2")
> > Set objStartup = objWMIService.Get("Win32_ProcessStartup")
> > Set objConfig = objStartup.SpawnInstance_
> > objConfig.ShowWindow = WINDOW_STATE
> > Set objProcess =
GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
> > strComputer & "\root\cimv2:Win32_Process")
> > errReturn = objProcess.Create("Notepad.exe", null, objConfig,
intProcessID)
> Hi,
>
> Sorry, that is not possible with the Win32_Process.Create method...
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.mspx