![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | get-service I'm trying to find a property of a service -- Start-Up Type (Automatic, Manual, Disabled) -- but cannot seem to locate it. I have tried a number of values found in get-service | get-member, all without success. Does anyone know which property contains or method returns this value? Thanks, Bart Perrier |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: get-service you can use WMI for this get-wmiObject win32_service will get the startmode also PoSH>gwmi win32_service ExitCode : 1077 Name : Alerter ProcessId : 0 StartMode : Disabled State : Stopped Status : OK Greetings /\/\o\/\/ www.ThePowerShellGuy.com "Bart Perrier" <bart_perrier@hotmail.com> wrote in message news:uOxsnQPBHHA.4992@TK2MSFTNGP03.phx.gbl... > I'm trying to find a property of a service -- Start-Up Type (Automatic, > Manual, Disabled) -- but cannot seem to locate it. I have tried a number > of values found in get-service | get-member, all without success. > > Does anyone know which property contains or method returns this value? > > Thanks, > Bart Perrier > |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: get-service How about through registry? cd hklm:\system\currentcontrolset\services How can i recurse through the hives and get the values of each "START" subkey? I see the member of get-childitem GETVALUE and GETVALUENAMES but I'm not sure how to pipe this....??? |
My System Specs![]() |
| | #4 (permalink) |
| Guest | Re: get-service On Fri, 10 Nov 2006 12:15:06 -0600, "Bart Perrier" <bart_perrier@hotmail.com> wrote: >I'm trying to find a property of a service -- Start-Up Type (Automatic, >Manual, Disabled) -- but cannot seem to locate it. I have tried a number of >values found in get-service | get-member, all without success. > >Does anyone know which property contains or method returns this value? > >Thanks, >Bart Perrier As as far as I'm aware it's not exposed using the get-service cmdlet. I assume that you want to know / set the startup setting fora small number of services. I say that because you can't use wildcards with the -name parameter of set-service. One (not very elegant) approach is to use the -StartupType parameter of the set-service cmdlet with the -whatif parameter also set to set the startup value for a service of interest. If that doesn't appeal then Marc's get-wmiobject Win32_Service approach is one way to go. Andrew Watt MVP |
My System Specs![]() |
| | #5 (permalink) |
| Guest | RE: get-service function StartType ($start) { switch ($start) { 0 {return "Boot";Continue } 1 {return "System";Continue} 2 {return "Automatic";Continue} 3 {return "Manual";Continue} 4 {return "Disabled";Continue} "" {return "Unknown";Continue} } } gci hklm:\system\currentcontrolset\services | %{ $_.pschildname + ' : ' + (StartType((gp $_.pspath).start)) ;$s=$_.pschildname;get-wmiobject win32_service | select name, state | ? { $_.name -eq $s};} How can i flip this code around so that I am matching HKLM values on the win32_service returned names? get-wmiobject win32_service | select name, state | %{gci hklm:\system\currentcontrolset\services\ | %{(gp $_.pspath).start}} |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to install service to bypass Vista Interactive Services Detection Service | kianlie84 | Vista security | 0 | 08-28-2008 02:25 AM |
| The Windows Firewall service terminated with service-specific erro | Kraig | Vista security | 1 | 08-06-2008 05:51 PM |
| The Windows Firewall service terminated with service-specific erro | DaMnIt | Vista security | 7 | 10-10-2007 12:34 PM |
| PDIHWCTL service failed, EventID: 7000, Source: Service Control Manager Eventlog Provider | ls [sb] | Vista General | 0 | 06-20-2007 10:20 PM |
| Security Service and Windows Wireless Service stopped working | Kolin Tregaskes | Vista General | 3 | 06-11-2007 12:34 PM |