Bird
0
0

You want to list all services that are currently running on a remote computer named 'Server01' using CIM cmdlets. Which command is correct?

hard📝 Application Q15 of 15
PowerShell - Remote Management
You want to list all services that are currently running on a remote computer named 'Server01' using CIM cmdlets. Which command is correct?
AGet-CimInstance -ClassName Win32_Service -ComputerName Server01 | Where-Object { $_.Status -eq 'Running' }
BGet-WmiObject -Class Win32_Service -ComputerName Server01 | Where-Object { $_.Status -eq 'Running' }
CGet-CimInstance -ClassName Win32_Service -ComputerName Server01 | Where-Object { $_.State -eq 'Running' }
DGet-CimInstance -ClassName Win32_Service -ComputerName Server01 | Where-Object { $_.State -eq 'Stopped' }
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct property for running services

    The property State with value 'Running' correctly filters running services in Win32_Service.
  2. Step 2: Choose the correct cmdlet and filter

    Using Get-CimInstance with -ComputerName is modern and correct. Filtering with Where-Object { $_.State -eq 'Running' } matches running services.
  3. Final Answer:

    Get-CimInstance -ClassName Win32_Service -ComputerName Server01 | Where-Object { $_.State -eq 'Running' } -> Option C
  4. Quick Check:

    Filter by State='Running' with Get-CimInstance [OK]
Quick Trick: Filter services by State='Running' using Get-CimInstance [OK]
Common Mistakes:
  • Using Status instead of State property
  • Filtering for 'Stopped' instead of 'Running'
  • Mixing Get-WmiObject with CIM cmdlets

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes