0% found this document useful (0 votes)
14 views13 pages

PowerShell Process and Service Management

This document outlines a lab exercise focused on managing processes and services in Windows using PowerShell. Students will learn to list, monitor, and stop processes, as well as view system services and their statuses. The lab aims to enhance understanding of Windows process and service management through practical commands and examples.

Uploaded by

kiabat914
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views13 pages

PowerShell Process and Service Management

This document outlines a lab exercise focused on managing processes and services in Windows using PowerShell. Students will learn to list, monitor, and stop processes, as well as view system services and their statuses. The lab aims to enhance understanding of Windows process and service management through practical commands and examples.

Uploaded by

kiabat914
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

ICT AND PROGRAMMING

LAB:6

BAKHTAWAR KHAN
Processes & Services Basics

Objective

To explore how Windows manages active applications and background services using PowerShell.

Students will learn how to list, monitor, and safely stop processes, and view the status of system services.
Processes & Services Basics

Theory

Before performing commands, let’s understand the key terms:

1. Process

• A process is an instance of a running program.

• Every app you open (like Notepad, Chrome, or Word) becomes a process.

• The operating system (OS) manages CPU and memory for each process.

• Example: Opening multiple Chrome tabs starts multiple Chrome processes.


2. Service

• A service is a background process that runs without user interaction.

• These handle system-level tasks like networking, printing, or updates.

• Example: Windows Update Service (wuauserv) runs automatically to check for updates.

3. Process Management in PowerShell

• PowerShell allows you to list, monitor, or stop processes.

• Example: You can stop a frozen program safely using a command instead of Task Manager.

4. Service Management in PowerShell

• You can view all services, their running status, and start or stop them when needed.

• This is useful for diagnosing slow performance or testing system operations.


Step-by-Step Procedure

1. Open PowerShell
Press Win + S → type PowerShell → right-click → Run as Administrator.

2. View All Active Processes

Get-Process

→ Displays all running programs with details such as CPU usage, memory, and process ID (PID).
3. Stop a Specific Process (Simulation Mode)

Stop-Process -Name notepad -WhatIf

→ This command does not actually stop the process but shows what would happen if executed safe for
practice.

4. View All Services

Get-Service

→ Lists all Windows services with their Name, DisplayName, and Status (Running or Stopped).

5. Check Specific Service


Example:

Get-Service -Name wuauserv

→ Displays the status of the Windows Update Service.


Sample Expected Outputs

• From Get-Process
Handles NPM(K) PM(K) WS(K) CPU(s) Id ProcessName
------- ------ ----- ----- ------- -- ------------
340 18 42344 61232 25.38 1024 chrome
215 12 15872 28440 3.42 1308 notepad

• From Stop-Process -Name notepad -WhatIf


What if: Performing the operation "Stop-Process" on target "notepad (1308)".

• From Get-Service
Status Name DisplayName
------ ---- -----------
Running wuauserv Windows Update
Stopped Spooler Print Spooler
Running WinDefend Microsoft Defender Antivirus Service
Explanation

1. Get-Process

Purpose:
Displays all the programs and background processes currently running on your computer.

What Happens Internally:

• When you run Get-Process, PowerShell communicates with the Windows Process Manager.

• It collects information from the system about every process that is active, including:

• Process Name: the name of the program (e.g., chrome, notepad).

• ID (PID): a unique number given to each running process by Windows.

• CPU Time: total time that the process has used the processor.

• Memory Usage (WS, PM): how much RAM that process is consuming.
2. Stop-Process -Name notepad -WhatIf

Purpose:
Tests what would happen if you stopped (terminated) a process, but without actually ending it.

What Happens Internally:

• Normally, Stop-Process -Name notepad would send a termination signal to Notepad and close it
immediately (similar to ending a task in Task Manager).

• However, the -WhatIf parameter is a safety switch, it prevents the command from executing but shows
what it would do if it were run.
3. Get-Service

Purpose:
Lists all Windows Services, programs that run in the background to support the operating system and
applications.

What Happens Internally:

• PowerShell queries the Windows Service Control Manager (SCM), the system that manages all
background services.

• It retrieves the following details for every service installed:

• Name: the short internal name of the service.

• DisplayName: the user-friendly name shown in the Services app.

• Status: tells whether the service is currently Running, Stopped, or Paused.


4. Get-Service -Name wuauserv

Purpose:
Shows information about a specific service, in this case, the Windows Update Service (wuauserv).

What Happens Internally:

PowerShell looks for the service named wuauserv in the Service Control Manager database.
Deliverables

ITEM VALUE

Number of Running Processes

Example Process Name

Example Service Name

Status of Example Service


Learning Outcomes

After completing this lab, students will:

• Understand the concept of processes and services in Windows.

• Learn how to list and monitor active processes.

• Safely stop a process using PowerShell.

• View and interpret service statuses for system diagnostics.

You might also like