Re: Run remote process as currently logged in user
From: TwistedPair (twistedpair_at_mail.com)
Date: 08/05/04
- Next message: TwistedPair: "Re: Run remote process as currently logged in user"
- Previous message: Torgeir Bakken \(MVP\): "Re: Run remote process as currently logged in user"
- In reply to: Torgeir Bakken \(MVP\): "Re: Run remote process as currently logged in user"
- Next in thread: TwistedPair: "Re: Run remote process as currently logged in user"
- Reply: TwistedPair: "Re: Run remote process as currently logged in user"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 5 Aug 2004 12:24:07 -0700
Thank you very much for your help, but doesn't this require their password
to run? Suppose you don't have that? Is there any way to get it to run as
the user, or at least on their desktop without the username and password?
Thanks,
Pair
"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:%23BRfgCyeEHA.1724@TK2MSFTNGP10.phx.gbl...
> TwistedPair wrote:
>
> > Hi all,
> > The following can launche notepad on a remote machine. But it will run
with
> > whatever credentials I ran it from. How do I get it to run with
credentials
> > of the currently logged in user? Any ideas?
> > strComputer = "remote machine"
> > Set objWMIService = GetObject("winmgmts:" _
> > & "{impersonationLevel=impersonate}!\\" & strComputer _
> > & "\root\cimv2:Win32_Process")
> >
> > Error = objWMIService.Create("notepad.exe", null, _
> > null, intProcessID)
> > If Error = 0 Then
> > Wscript.Echo "Notepad was started with a process ID of " _
> > & intProcessID & "."
> > Else
> > Wscript.Echo "Notepad could not be started due to error " _
> > & Error & "."
> > End If Thanks,Pair
> Hi
>
>
> You can connect with explicit user credentials (e.g. the
> local Administrator user on the remote computer) using
> SWbemLocator.ConnectServer.
>
> IWbemLocator::ConnectServer
>
http://msdn.microsoft.com/library/en-us/wmisdk/wmi/iwbemlocator_connectserver.asp
>
> Subject: Login with explicit username and password
> Newsgroups: microsoft.public.win32.programmer.wmi
> http://groups.google.com/groups?th=2b5bcad76f5debaa
>
> Subject: ImpersoantionLevel other than impersonate
> Newsgroups: microsoft.public.scripting.wsh
> http://groups.google.com/groups?th=89ff50603f12dcfb
>
>
>
> --
> 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
- Next message: TwistedPair: "Re: Run remote process as currently logged in user"
- Previous message: Torgeir Bakken \(MVP\): "Re: Run remote process as currently logged in user"
- In reply to: Torgeir Bakken \(MVP\): "Re: Run remote process as currently logged in user"
- Next in thread: TwistedPair: "Re: Run remote process as currently logged in user"
- Reply: TwistedPair: "Re: Run remote process as currently logged in user"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|