![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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 | Re: Get startup type from service? In message <CB3D9FE3-FDB5-41EC-9732-B8F9FF622A6B@microsoft.com>, Andy Webster <AndyWebster@discussions.microsoft.com> writes >Hi > >Can anyone help? > >I want to get a list of services whose startup type is automatic but the >Get-Service cmdlet does not seem to provide this property, seems odd. > >I cannot simply check if a service is running as I want to get a list of >services whose startup type is set to automatic that are not currently >running. I want this list because some services are not starting after a >reboot even though they are set to automatic and I want to be informed of >these when it happens One way would be to look at the contents of the registry. Take a look at my blog: http://tfl09.blogspot.com/2007/01/us...owershell.html or http://tinyurl.com/2hvj38. To print out the services, you could do something like this: $shive= "HKLM:\SYSTEM\currentcontrolset\Services\" $Services=ls -path $shive # foreach ($s in $services) { $sername=($s.name.split("\"))[($s.name.split("\").count-1)] $ss= get-ItemProperty -path registry::$s -erroraction silentlycontinue if ($ss) {"Servce: $sername, startuptype= $($ss.start)"} } Now- to do what you want, you'd need to get the actually running services, and see if a service with servicename -eq $sername exists, ot not. HTH Thomas -- Thomas Lee doctordns@gmail.com MVP - Admin Frameworks and Security |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Display actual file type, not description of the type | Doug | Vista file management | 3 | 10-12-2007 01:40 AM |
| Display the actual type, rather than the description of the type | Doug | Vista General | 4 | 10-11-2007 10:42 AM |
| Unable to find type [Drawing.Image]: make sure that the assembly containing this type is loaded | IT Staff | PowerShell | 4 | 08-16-2007 08:55 PM |
| Re: Get startup type from service? | Gaurhoth | PowerShell | 1 | 01-17-2007 08:36 AM |