Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Get-Service : Default status

Reply
 
Old 06-13-2007   #1 (permalink)
Justin Rich


 
 

Get-Service : Default status

figured out to to get the status and a bunch of other stuff.. but i cant
figure out what the default status is. basically im looking for a way to
list only services that are not running that should be running. can do most
of it, just cant figure out what the state should be (looking for startup
type Automatic)

Thanks
Justin



My System SpecsSystem Spec
Old 06-13-2007   #2 (permalink)
Justin Rich


 
 

Re: Get-Service : Default status

Just figured out how to do it with WMI

Get-WmiObject Win32_Service | where {$_.StartMode -eq "Auto"} | where
{$_.State -eq "Stopped"}


"Justin Rich" <jrich523@yahoo.com.spam> wrote in message
news:OZO8egfrHHA.3228@TK2MSFTNGP03.phx.gbl...
> figured out to to get the status and a bunch of other stuff.. but i cant
> figure out what the default status is. basically im looking for a way to
> list only services that are not running that should be running. can do
> most of it, just cant figure out what the state should be (looking for
> startup type Automatic)
>
> Thanks
> Justin
>



My System SpecsSystem Spec
Old 06-13-2007   #3 (permalink)
Hal Rottenberg


 
 

Re: Get-Service : Default status

On Jun 13, 6:19 pm, "Justin Rich" <jrich...@yahoo.spam> wrote:
> Just figured out how to do it with WMI
>
> Get-WmiObject Win32_Service | where {$_.StartMode -eq "Auto"} | where
> {$_.State -eq "Stopped"}


This also works:

Get-WmiObject win32_service | where { $_.startmode -eq "auto" -and
$_.state -eq "stopped" }

My System SpecsSystem Spec
Old 06-14-2007   #4 (permalink)
Justin Rich


 
 

Re: Get-Service : Default status

I guess i should have known that. with some quick digging i wasnt able to
find "-and" i had tried just "and" but i guess its pretty obvious i should
have used -and

Thanks for tweaking it

Justin

"Hal Rottenberg" <halr9000@gmail.com> wrote in message
news:1181779795.337167.216020@a26g2000pre.googlegroups.com...
> On Jun 13, 6:19 pm, "Justin Rich" <jrich...@yahoo.spam> wrote:
>> Just figured out how to do it with WMI
>>
>> Get-WmiObject Win32_Service | where {$_.StartMode -eq "Auto"} | where
>> {$_.State -eq "Stopped"}

>
> This also works:
>
> Get-WmiObject win32_service | where { $_.startmode -eq "auto" -and
> $_.state -eq "stopped" }
>



My System SpecsSystem Spec
Old 06-21-2007   #5 (permalink)
Desmond Lee


 
 

Re: Get-Service : Default status

This is one of several cases where WMI is needed beyond the built-in cmdlet.

(for another example: http://www.leedesmond.com/weblog/?p=128)

--
............... All new, all fresh ..............
http://www.leedesmond.com/weblog/



"Justin Rich" wrote:

> Just figured out how to do it with WMI
>
> Get-WmiObject Win32_Service | where {$_.StartMode -eq "Auto"} | where
> {$_.State -eq "Stopped"}
>
>
> "Justin Rich" <jrich523@yahoo.com.spam> wrote in message
> news:OZO8egfrHHA.3228@TK2MSFTNGP03.phx.gbl...
> > figured out to to get the status and a bunch of other stuff.. but i cant
> > figure out what the default status is. basically im looking for a way to
> > list only services that are not running that should be running. can do
> > most of it, just cant figure out what the state should be (looking for
> > startup type Automatic)
> >
> > Thanks
> > Justin
> >

>
>
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
The system event notification service service failed logon ... token does not exist General Discussion
Re: vista ultimate 64-bit default programs and IE7 default email p Vista mail
RPC service default settings ?? Vista General
Vista keeps stealing default status from default printer computer Vista networking & sharing
RE: Default Users/My User location, is it possible to move the default to D:/ drive? Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46