Can I set a service to run in its own container thru Powershell? ie.
What is the Powershell equivalent of sc config <service name> type= own
Can I set a service to run in its own container thru Powershell? ie.
What is the Powershell equivalent of sc config <service name> type= own
You can change service type property on the corresponding WMI object.
# get service
$s = (Get-WmiObject win32_service -filter "Name='Fax'")
# change service type
$s.Change($null, $null, 16) # 16 = "Own Process"
Other values you can find here (http://msdn.microsoft.com/en-us/library/aa384901(v=vs.85).aspx)
Make sure that ReturnValue from change method is equal to 0. Meaning of error codes you can find in the link above.