Bird
0
0

You need to retrieve all services that are set to start automatically on a remote computer named 'RemotePC' using CIM cmdlets. Which command is correct?

hard📝 Application Q8 of 15
PowerShell - Remote Management
You need to retrieve all services that are set to start automatically on a remote computer named 'RemotePC' using CIM cmdlets. Which command is correct?
AGet-CimInstance -ClassName Win32_Service -Filter "StartMode = 'Auto'" -ComputerName RemotePC
BGet-CimInstance -ClassName Win32_Service -Filter "State = 'Running'" -ComputerName RemotePC
CInvoke-CimMethod -ClassName Win32_Service -MethodName GetServices -ComputerName RemotePC
DNew-CimSession -ComputerName RemotePC | Get-CimInstance -ClassName Win32_Service -Filter "StartMode = 'Manual'"
Step-by-Step Solution
Solution:
  1. Step 1: Identify the requirement

    Retrieve services with StartMode set to 'Auto' (automatic start).
  2. Step 2: Analyze options

    Get-CimInstance -ClassName Win32_Service -Filter "StartMode = 'Auto'" -ComputerName RemotePC uses correct class, filter, and remote computer parameter.
  3. Step 3: Eliminate incorrect options

    Get-CimInstance -ClassName Win32_Service -Filter "State = 'Running'" -ComputerName RemotePC filters by running state, not start mode; Invoke-CimMethod -ClassName Win32_Service -MethodName GetServices -ComputerName RemotePC uses Invoke-CimMethod incorrectly; New-CimSession -ComputerName RemotePC | Get-CimInstance -ClassName Win32_Service -Filter "StartMode = 'Manual'" filters for 'Manual' start mode and misuses session.
  4. Final Answer:

    Get-CimInstance -ClassName Win32_Service -Filter "StartMode = 'Auto'" -ComputerName RemotePC -> Option A
  5. Quick Check:

    Filter matches automatic start services on remote computer [OK]
Quick Trick: Use -Filter with StartMode='Auto' and -ComputerName for remote [OK]
Common Mistakes:
  • Filtering by State instead of StartMode
  • Using Invoke-CimMethod instead of Get-CimInstance
  • Incorrect filter values like 'Manual' instead of 'Auto'

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes