View Single Post
Old 01-22-2008   #2 (permalink)
Marco Shaw [MVP]


 
 

Re: How to start a remote service under a different user name

Flea# wrote:
Quote:

> Hello,
>
> I need to be able to start a service a remote server under a different logon
> name using PowerShell. If you right click on a service and choose properties
> you can click on the 'Log On' tab and by default it uses a system account but
> gives you the option to run it as a different account. Is there a way to do
> this using PowerShell and probably WMI?
>
> I was looking at the ServiceController.Start Method (String[]) which allows
> you to pass parameters but I could not find examples of what parameters you
> could pass. Does anyone know if this is possible?
>
> Thanks,
> Flea
>
I haven't checked other options, but there doesn't seem to be any option
to pass along.

I wasn't able to confirm either that the Start method accepted any kind
of argument.

http://msdn2.microsoft.com/en-us/lib...r_members.aspx

No solution, but it might be possible.

At the very least, maybe the 'log on' name can be changed directly, then
the service started?

Marco

--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
My System SpecsSystem Spec