nerdexam
CompTIA

SK0-004 · Question #645

An administrator wants to use a PowerShell cmdlet to find the running services on a Windows server. Which of the following are PowerShell cmdlet commands that will accomplish this task? (Choose two.)

The correct answer is A. get-process B. get-service. PowerShell provides native cmdlets including Get-Service and Get-Process to enumerate service and process state on a Windows server without relying on legacy command-line tools.

Server administration

Question

An administrator wants to use a PowerShell cmdlet to find the running services on a Windows server. Which of the following are PowerShell cmdlet commands that will accomplish this task? (Choose two.)

Options

  • Aget-process
  • Bget-service
  • Cnetstat
  • Dget-wmiobject 璫lass win32_service
  • Eipconfig

How the community answered

(59 responses)
  • A
    92% (54)
  • C
    2% (1)
  • D
    2% (1)
  • E
    5% (3)

Why each option

PowerShell provides native cmdlets including Get-Service and Get-Process to enumerate service and process state on a Windows server without relying on legacy command-line tools.

Aget-processCorrect

Get-Process retrieves all currently running processes on the system, which includes the host processes that back Windows services, providing visibility into what is actively executing on the server.

Bget-serviceCorrect

Get-Service is the primary PowerShell cmdlet for listing Windows services and their current status (Running, Stopped, or Paused), making it the most direct command for finding running services.

Cnetstat

Netstat is a legacy command-line networking utility that displays active TCP/UDP connections and listening ports, not a PowerShell cmdlet and unrelated to listing services.

Dget-wmiobject 璫lass win32_service

As displayed in the question, this choice contains a corrupted character in place of the '-c' flag, making it syntactically invalid as written; the intended 'Get-WmiObject -Class Win32_Service' would otherwise be valid but was not presented correctly.

Eipconfig

Ipconfig is a command-line tool that displays network adapter IP configuration and is not a PowerShell cmdlet or a method for listing running services.

Concept tested: PowerShell cmdlets for enumerating Windows services

Source: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-service

Topics

#PowerShell#cmdlets#Windows services#server management

Community Discussion

No community discussion yet for this question.

Full SK0-004 Practice