Re: Run remote process as currently logged in user

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: TwistedPair (twistedpair_at_mail.com)
Date: 08/05/04


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



Relevant Pages

  • Re: WMI security, XP to XP
    ... I had put SP2 on the test Pc ... > Newsgroups: microsoft.public.win32.programmer.wmi ... > Subject: ImpersoantionLevel other than impersonate ... > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.win32.programmer.wmi)
  • Re: WMI security, XP to XP
    ... I suspect its one of the recompiled core> components in SP2. ... >> Newsgroups: microsoft.public.win32.programmer.wmi ... >> Subject: ImpersoantionLevel other than impersonate ... >> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.win32.programmer.wmi)
  • Re: Win32_QFE and domain auth question
    ... > I just don't know a way to add in authenication credentials... ... For WMI, you can connect connect with explicit user credentials ... Subject: ImpersoantionLevel other than impersonate ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.win32.programmer.wmi)
  • Re: Scripting remote WMI problem
    ... > way) my domain admin is unavailable for a week or 2. ... Newsgroups: microsoft.public.win32.programmer.wmi ... Subject: ImpersoantionLevel other than impersonate ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.windowsxp.general)
  • Re: WMI security, XP to XP
    ... and then you will need to connect with explicit user credentials ... Newsgroups: microsoft.public.win32.programmer.wmi ... Subject: ImpersoantionLevel other than impersonate ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.win32.programmer.wmi)