PowerTip: Find Services with the Same Dependencies with PowerShell

PowerTip: Find Services with the Same Dependencies with PowerShell

  • Comments 1
  • Likes

Summary: Use Windows PowerShell to find services that have the same dependencies.

Hey, Scripting Guy! Question How can I use Windows PowerShell to easily find services that have the same dependencies?

Hey, Scripting Guy! Answer Use the Get-Service cmdlet with the RequiredServices parameter, and supply the name of the dependent service. (The following example shows services that require the rpcss service on my laptop.)

PS C:\> Get-Service -RequiredServices rpcss

 

Status   Name               DisplayName

------   ----               -----------

Running  DcomLaunch         DCOM Server Process Launcher

Running  RpcEptMapper       RPC Endpoint Mapper

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Just would like to add:

    Q: how to show all services

    A: gsv | select -Unique name

    --------------------------------------------------------------------------

    Q: how to show all running services

    A: gsv | ?{$_.status -match "running"} | select -Unique name