Start Process under different user (with WMI) 
Author Message
 Start Process under different user (with WMI)

I asked a similar (but not the same) question in the WSH forum:

I am using VB Script and WSH 5.6 and so can use WMI objects / classes,
e.g. Win32 / Operating system classes like Win32_ProcessStartup.

Is it possible (and how to do it) to start a process / program under a
different user with supply of username and password by using those
classes (plus methods and properties)? Any example?

- Win32_ProcessStartup: obviously no user, password available.
- SWbemLocator.ConnectServer method: start a PROCESS with a user/pw?

Out of a C program I know the LogonUser and CreateProcessAsUser API
calls, but I want to use it out of WSH/VBS, so I need some kind of WMI
class/object.

Thanks!
Gnther



Tue, 16 Aug 2005 19:49:15 GMT  
 Start Process under different user (with WMI)

Quote:

> I am using VB Script and WSH 5.6 and so can use WMI objects / classes,
> e.g. Win32 / Operating system classes like Win32_ProcessStartup.

> Is it possible (and how to do it) to start a process / program under a
> different user with supply of username and password by using those
> classes (plus methods and properties)? Any example?

> - Win32_ProcessStartup: obviously no user, password available.
> - SWbemLocator.ConnectServer method: start a PROCESS with a user/pw?

> Out of a C program I know the LogonUser and CreateProcessAsUser API
> calls, but I want to use it out of WSH/VBS, so I need some kind of WMI
> class/object.

Hi

SWbemLocator.ConnectServer can only be used against a remote computer, it is
not supported for a connection to the host with another set of credentials.

--
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



Tue, 16 Aug 2005 21:38:24 GMT  
 Start Process under different user (with WMI)
What OS are you using?  Can you not just use the Create method in the
Win32_Process, and call RUNAS.EXE and supply the credentials there?  Seems
to be that would work.

Jeff Cheung


Quote:
> I asked a similar (but not the same) question in the WSH forum:

> I am using VB Script and WSH 5.6 and so can use WMI objects / classes,
> e.g. Win32 / Operating system classes like Win32_ProcessStartup.

> Is it possible (and how to do it) to start a process / program under a
> different user with supply of username and password by using those
> classes (plus methods and properties)? Any example?

> - Win32_ProcessStartup: obviously no user, password available.
> - SWbemLocator.ConnectServer method: start a PROCESS with a user/pw?

> Out of a C program I know the LogonUser and CreateProcessAsUser API
> calls, but I want to use it out of WSH/VBS, so I need some kind of WMI
> class/object.

> Thanks!
> Gnther



Wed, 17 Aug 2005 01:57:34 GMT  
 Start Process under different user (with WMI)
In order to use RunAs the appropriate service must be installed. That's some
kind of problem for us. Moreover I am not sure if  RunAs allows
non-interactive  password input (i.e. by script).

Gnther

"Cheung, Jeff" schrieb:

Quote:
> What OS are you using?  Can you not just use the Create method in the
> Win32_Process, and call RUNAS.EXE and supply the credentials there?  Seems
> to be that would work.

> Jeff Cheung



> > I asked a similar (but not the same) question in the WSH forum:

> > I am using VB Script and WSH 5.6 and so can use WMI objects / classes,
> > e.g. Win32 / Operating system classes like Win32_ProcessStartup.

> > Is it possible (and how to do it) to start a process / program under a
> > different user with supply of username and password by using those
> > classes (plus methods and properties)? Any example?

> > - Win32_ProcessStartup: obviously no user, password available.
> > - SWbemLocator.ConnectServer method: start a PROCESS with a user/pw?

> > Out of a C program I know the LogonUser and CreateProcessAsUser API
> > calls, but I want to use it out of WSH/VBS, so I need some kind of WMI
> > class/object.

> > Thanks!
> > Gnther



Fri, 19 Aug 2005 20:43:01 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. wmi remote process without local user profile

2. Using Script to start Application with different credentials

3. Start webpage with different credentials

4. Using scrip to start application with different cuser credentials

5. WMI Processes

6. Starting a background process on an NT server?

7. WMI Process CPU load

8. Starting processes on reomte machienes

9. Starting a Process on a Remote System

10. Set process priority using WMI

11. Remote WMI for detecting processes

12. Killing a process in NT (without using WMI)

 

 
Powered by phpBB® Forum Software