PS: Managing Windows Services

List all services that a service is dependent on on:

[5]: Get-Service -Name LanmanWorkstation -DependentServices

Status   Name               DisplayName                           ------   ----               -----------                           Running  SessionEnv         Remote Desktop Configuration          Running  Netlogon           Netlogon                              Stopped  Browser            Computer Browser                      

 

This will be helpful in identifying the possible service start up failures due to dependent service unavailability.

List all services that depend/require a selected service:

[6]: Get-Service -Name LanmanWorkstation -RequiredServices

Status   Name               DisplayName                           ------   ----               -----------                           Running  MRxSmb10           SMB 1.x MiniRedirector                Running  NSI                Network Store Interface Service       Running  MRxSmb20           SMB 2.0 MiniRedirector                Running  Bowser             Browser Support Driver                

This will be helpful in assessing the impact of a service outage.

List all services by startup type/mode:

PS C:> Get-WMIObject Win32_Service | Where-Object { $_.StartMode -notmatch ‘auto’ } | Select-Object Name, StartMode, State| sort StartMode | ft -AutoSize

Name                           StartMode State

—-                           ——— —–

clr_optimization_v2.0.50727_32 Disabled  Stopped

Bonjour Service                Disabled  Stopped

NetPipeActivator               Disabled  Stopped

gupdate1c9f634eb27ed98         Disabled  Stopped

NetTcpActivator                Disabled  Stopped

Apple Mobile Device            Disabled  Stopped

Mcx2Svc                        Disabled  Stopped

SSDPSRV                        Manual    Running

WinRM                          Manual    Stopped

WPDBusEnum                     Manual    Stopped

WwanSvc                        Manual    Stopped

AeLookupSvc                    Manual    Stopped

wmiApSrv                       Manual    Stopped

MSiSCSI                        Manual    Stopped

PS C:>

 

An alternate way is to try this, helpful if you have to query single service.

PS C:> ([wmi]’Win32_Service.Name="browser"’).StartMode

Manual

PS C:>

 

More:

Leave a Reply

Your email address will not be published. Required fields are marked *