I am trying to run a process, like notepad, on a remote computer. I can do
this successfully HOWEVER, I want to know if it is possible at all to run
this process on a user account that is logged in so if i run notepad it will
open it up on their screen?

so if I'm logged in right now....I run a script from a remote computer
telling this local computer to open notepad - is it possible to open it in
that user account so the user can see it (displayed infront of them)?

Re: Run remote process by gomer

gomer
Tue Oct 10 15:22:58 CDT 2006

PSEXEC from sysinternals.
free download



"Ahmed Ilyas" <AhmedIlyas@discussions.microsoft.com> wrote in message
news:361E92FA-AB12-4364-B2E8-E3CE73B7B393@microsoft.com...
>I am trying to run a process, like notepad, on a remote computer. I can do
> this successfully HOWEVER, I want to know if it is possible at all to run
> this process on a user account that is logged in so if i run notepad it
> will
> open it up on their screen?
>
> so if I'm logged in right now....I run a script from a remote computer
> telling this local computer to open notepad - is it possible to open it in
> that user account so the user can see it (displayed infront of them)?



Re: Run remote process by AhmedIlyas

AhmedIlyas
Tue Oct 10 15:35:03 CDT 2006

Thanks but is there no way of doing it IN WMI?

"gomer" wrote:

> PSEXEC from sysinternals.
> free download
>
>
>
> "Ahmed Ilyas" <AhmedIlyas@discussions.microsoft.com> wrote in message
> news:361E92FA-AB12-4364-B2E8-E3CE73B7B393@microsoft.com...
> >I am trying to run a process, like notepad, on a remote computer. I can do
> > this successfully HOWEVER, I want to know if it is possible at all to run
> > this process on a user account that is logged in so if i run notepad it
> > will
> > open it up on their screen?
> >
> > so if I'm logged in right now....I run a script from a remote computer
> > telling this local computer to open notepad - is it possible to open it in
> > that user account so the user can see it (displayed infront of them)?
>
>
>

Re: Run remote process by AhmedIlyas

AhmedIlyas
Tue Oct 10 15:36:01 CDT 2006

Thanks but is there no way of doing it within WMI?

"gomer" wrote:

> PSEXEC from sysinternals.
> free download
>
>
>
> "Ahmed Ilyas" <AhmedIlyas@discussions.microsoft.com> wrote in message
> news:361E92FA-AB12-4364-B2E8-E3CE73B7B393@microsoft.com...
> >I am trying to run a process, like notepad, on a remote computer. I can do
> > this successfully HOWEVER, I want to know if it is possible at all to run
> > this process on a user account that is logged in so if i run notepad it
> > will
> > open it up on their screen?
> >
> > so if I'm logged in right now....I run a script from a remote computer
> > telling this local computer to open notepad - is it possible to open it in
> > that user account so the user can see it (displayed infront of them)?
>
>
>

Re: Run remote process by Richard

Richard
Tue Oct 10 19:24:42 CDT 2006

Ahmed Ilyas wrote:

> Thanks but is there no way of doing it IN WMI?

You can use SWbenLocator. Of course, you must know the username/password.
Example below that runs Windows Explorer on the remote computer:
=================
Option Explicit

Dim strComputer
Dim strUser
Dim strPassword
Dim objSWbemLocator
Dim objSWbemServices
Dim objProcess
Dim intReturnCode

strComputer = InputBox("Enter remote computer name", "RunRemote")
strUser = InputBox("Enter user name on remote computer", "RunRemote")
strPassword = InputBox("Enter password", "RunRemote")

Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objSWbemServices = objSWbemLocator.ConnectServer _
(strComputer, "root\cimv2", strUser, strPassword)

Set objProcess = objSWbemServices.Get("Win32_Process")

intReturnCode = objProcess.Create("explorer.exe")
If (intReturnCode <> 0) Then
Call MsgBox("Failed to start Explorer")
Else
Call MsgBox("Explorer started on remote computer")
End If

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net



Re: Run remote process by AhmedIlyas

AhmedIlyas
Tue Oct 10 19:33:02 CDT 2006

I'll try to give this a shot sometime, thanks very much!
I'm actually trying to integrate this into .NET (C#) so, see how it goes.
Just hope that if the user is logged in and I run this script that it will
show that program to the user on their screen as if by magic!

"Richard Mueller" wrote:

> Ahmed Ilyas wrote:
>
> > Thanks but is there no way of doing it IN WMI?
>
> You can use SWbenLocator. Of course, you must know the username/password.
> Example below that runs Windows Explorer on the remote computer:
> =================
> Option Explicit
>
> Dim strComputer
> Dim strUser
> Dim strPassword
> Dim objSWbemLocator
> Dim objSWbemServices
> Dim objProcess
> Dim intReturnCode
>
> strComputer = InputBox("Enter remote computer name", "RunRemote")
> strUser = InputBox("Enter user name on remote computer", "RunRemote")
> strPassword = InputBox("Enter password", "RunRemote")
>
> Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
> Set objSWbemServices = objSWbemLocator.ConnectServer _
> (strComputer, "root\cimv2", strUser, strPassword)
>
> Set objProcess = objSWbemServices.Get("Win32_Process")
>
> intReturnCode = objProcess.Create("explorer.exe")
> If (intReturnCode <> 0) Then
> Call MsgBox("Failed to start Explorer")
> Else
> Call MsgBox("Explorer started on remote computer")
> End If
>
> --
> Richard
> Microsoft MVP Scripting and ADSI
> Hilltop Lab - http://www.rlmueller.net
>
>
>