![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| Guest | How to start a remote service under a different user name 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 -- http://fleasharp.blogspot.com/ |
My System Specs![]() |
| | #2 (permalink) |
| Guest | 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 > 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 Specs![]() |
| | #3 (permalink) |
| Guest | Re: How to start a remote service under a different user name Try the Change method, you can get more info on it here: http://msdn2.microsoft.com/en-us/library/aa384901.aspx ## Specify $null if you are not changing the password. ## Specify an empty string if the service has no password. ## When changing a service from a local system to a network, or from a network to a ## local system, StartPassword must be an empty string ("") and not $null. $user="domain\username" $psw = "password" $svc = Get-WmiObject win32_service -ComputerName computer -filter "name='alerter'" $svc.change($null,$null,$null,$null,$null,$null,$user,$psw,$null,$null,$null) # restart the service $svc.StopService() $svc.StartService() ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Quote: > 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 > 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...rocess.service > controller_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 > > PowerGadgets MVP > http://www.powergadgets.com/mvp > Blog: > http://marcoshaw.blogspot.com |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| [HELP] Can't Start Routing And Remote Access Service | Vista networking & sharing | |||
| Routing and remote access service can't start | Vista networking & sharing | |||
| Can't start Routing and Remote Access service | Vista networking & sharing | |||
| How to start a remote service under a different user account | PowerShell | |||
| Is it possible for a service to start a user app running with admin privilege? | Vista General | |||