Skip to content

03 — PowerShell for Cybersecurity

PowerShell is one of the most important scripting and automation technologies for Windows and Microsoft-focused cybersecurity work.

It gives security professionals direct access to:

WINDOWS
USERS
GROUPS
PROCESSES
SERVICES
EVENT LOGS
REGISTRY
FILESYSTEM
NETWORK CONFIGURATION
ACTIVE DIRECTORY
MICROSOFT CLOUD SERVICES

The key difference between PowerShell and many traditional shells is that PowerShell works primarily with:

OBJECTS

rather than only plain text.

This makes it extremely powerful for:

SECURITY ADMINISTRATION
INCIDENT RESPONSE
SOC OPERATIONS
WINDOWS HARDENING
ACTIVE DIRECTORY REVIEW
SECURITY AUTOMATION
EVIDENCE COLLECTION

Follow this sequence:

POWERSHELL SHELL
CMDLETS
OBJECTS
PIPELINE
VARIABLES
CONDITIONS
LOOPS
FUNCTIONS
FILES
PROCESSES
SERVICES
USERS
GROUPS
EVENT LOGS
REGISTRY
NETWORKING
ACTIVE DIRECTORY
SECURITY AUTOMATION

Windows remains deeply embedded in enterprise environments.

Cybersecurity professionals regularly need to:

CHECK LOCAL ADMINISTRATORS
REVIEW USER ACCOUNTS
INSPECT SERVICES
ANALYZE EVENT LOGS
REVIEW WINDOWS DEFENDER
CHECK FIREWALL SETTINGS
INSPECT REGISTRY CONFIGURATION
QUERY ACTIVE DIRECTORY
COLLECT INCIDENT EVIDENCE

PowerShell makes these tasks repeatable.

The core workflow is:

CMDLET
OBJECT
PIPELINE
FILTER
SELECT
SORT
EXPORT

Example:

GET PROCESSES
FILTER
SELECT INTERESTING FIELDS
EXPORT REPORT

Check your PowerShell version:

Terminal window
$PSVersionTable

You may be using:

Windows PowerShell 5.1

or:

PowerShell 7+

Both are useful, but some Windows-specific modules may behave differently.

PowerShell commands are commonly structured as:

VERB-NOUN

Examples:

Terminal window
Get-Process
Terminal window
Get-Service
Terminal window
Get-ChildItem
Terminal window
Get-LocalUser

This makes command discovery easier.

Use:

Terminal window
Get-Command

Search for commands related to services:

Terminal window
Get-Command *Service*

Search for event commands:

Terminal window
Get-Command *Event*

Use:

Terminal window
Get-Help Get-Process

Detailed:

Terminal window
Get-Help Get-Process -Detailed

Examples:

Terminal window
Get-Help Get-Process -Examples

Run:

Terminal window
Get-Process

The output looks tabular, but each row is an object.

Inspect:

Terminal window
Get-Process |
Get-Member

This shows:

Properties
Methods
Object Type

Instead of manually parsing text, you can directly request properties.

Example:

Terminal window
Get-Process |
Select-Object Name, Id, CPU

The pipe:

|

passes objects from one cmdlet to another.

Example:

Terminal window
Get-Process |
Sort-Object CPU -Descending

Then:

Terminal window
Get-Process |
Sort-Object CPU -Descending |
Select-Object -First 10
GET DATA
FILTER
SELECT
SORT
OUTPUT

Create:

Terminal window
$userName = "analyst01"
Terminal window
$sourceIP = "10.10.10.25"
Terminal window
$failedLogins = 7

Print:

Terminal window
$userName

or:

Terminal window
Write-Output $userName

Example:

Terminal window
$message = "Security event detected"

Double quotes expand variables:

Terminal window
Write-Output "User: $userName"

Single quotes do not:

Terminal window
Write-Output 'User: $userName'

Common types include:

String
Integer
Boolean
Array
Hashtable
Object

Check:

Terminal window
$userName.GetType()

Example:

Terminal window
$hosts = @(
"WEB01",
"APP01",
"DB01"
)

Loop:

Terminal window
foreach ($hostName in $hosts) {
Write-Output $hostName
}

Example:

Terminal window
$alert = @{
User = "admin01"
SourceIP = "10.10.10.25"
Severity = "High"
}

Access:

Terminal window
$alert["User"]

or:

Terminal window
$alert.User

Example:

Terminal window
$failedLogins = 12
if ($failedLogins -gt 10) {
Write-Output "High-risk authentication activity"
}
Terminal window
if ($failedLogins -ge 10) {
Write-Output "High"
}
elseif ($failedLogins -ge 5) {
Write-Output "Medium"
}
else {
Write-Output "Low"
}

Common:

-eq Equal
-ne Not equal
-gt Greater than
-lt Less than
-ge Greater or equal
-le Less or equal
-like Wildcard match
-match Regex match

Use:

-and
-or
-not

Example:

Terminal window
if (($failedLogins -gt 10) -and (-not $mfaEnabled)) {
Write-Output "High-risk condition"
}

Example:

Terminal window
foreach ($hostName in $hosts) {
Write-Output "Reviewing $hostName"
}
Terminal window
for ($i = 1; $i -le 5; $i++) {
Write-Output "Iteration $i"
}
Terminal window
$count = 1
while ($count -le 3) {
Write-Output "Run $count"
$count++
}

Example:

Terminal window
function Show-SecurityAlert {
param(
[string]$Message
)
Write-Output "ALERT: $Message"
}

Call:

Terminal window
Show-SecurityAlert -Message "Multiple failed logins"

Example:

Terminal window
function Get-RiskLevel {
param(
[int]$Count
)
if ($Count -ge 10) {
return "High"
}
elseif ($Count -ge 5) {
return "Medium"
}
else {
return "Low"
}
}

Run:

Terminal window
whoami

Then:

Terminal window
whoami /all

Review:

Current User
SID
Groups
Privileges
Integrity Level

Use:

Terminal window
hostname

or:

Terminal window
$env:COMPUTERNAME

Use:

Terminal window
Get-ComputerInfo

You can select specific fields:

Terminal window
Get-ComputerInfo |
Select-Object WindowsProductName, WindowsVersion, OsArchitecture

View:

Terminal window
Get-ChildItem Env:

Examples:

USERNAME
COMPUTERNAME
USERDOMAIN
USERPROFILE
PATH

Current directory:

Terminal window
Get-Location

List:

Terminal window
Get-ChildItem

Alias:

Terminal window
ls

Change directory:

Terminal window
Set-Location C:\Windows

Alias:

Terminal window
cd C:\Windows
Terminal window
New-Item `
-ItemType Directory `
-Path C:\Temp\SecurityLab `
-Force

Create folders:

Terminal window
$folders = @(
"Evidence",
"Logs",
"Reports",
"Scripts"
)
foreach ($folder in $folders) {
New-Item `
-ItemType Directory `
-Path "C:\Temp\SecurityLab\$folder" `
-Force |
Out-Null
}

Use:

Terminal window
Get-Content .\security.log

First lines:

Terminal window
Get-Content .\security.log |
Select-Object -First 10

Last lines:

Terminal window
Get-Content .\security.log |
Select-Object -Last 10

Use:

Terminal window
Get-Content .\security.log -Wait

This is useful for monitoring lab logs in real time.

Use:

Terminal window
Select-String `
-Path .\security.log `
-Pattern "FAILED"
Terminal window
Get-ChildItem .\Logs -File -Recurse |
Select-String -Pattern "ERROR"

Use only directories you are authorized to inspect.

Use:

Terminal window
"Security analysis started" |
Out-File .\report.txt

Append:

Terminal window
"Suspicious event detected" |
Out-File .\report.txt -Append

Security products frequently export CSV.

Import:

Terminal window
$events = Import-Csv .\events.csv

View:

Terminal window
$events

Example:

Terminal window
$events |
Where-Object Status -eq "Failed"
Terminal window
$events |
Export-Csv .\reports\events.csv -NoTypeInformation

Convert PowerShell objects to JSON:

Terminal window
$alert = @{
User = "admin01"
Severity = "High"
}
$alert |
ConvertTo-Json
Terminal window
$data = Get-Content .\alert.json -Raw |
ConvertFrom-Json

Access:

Terminal window
$data.User

Use:

Terminal window
Where-Object

Example:

Terminal window
Get-Service |
Where-Object Status -eq "Running"

Use:

Terminal window
Select-Object

Example:

Terminal window
Get-Service |
Select-Object Name, Status
Terminal window
Get-Process |
Sort-Object CPU -Descending

Use:

Terminal window
Group-Object

Example:

Terminal window
Get-Service |
Group-Object Status

Use:

Terminal window
Measure-Object

Example:

Terminal window
Get-Process |
Measure-Object

List:

Terminal window
Get-Process

Useful fields:

Terminal window
Get-Process |
Select-Object Name, Id, CPU, Path

Some process paths may require additional privileges.

Terminal window
Get-Process -Name powershell

or:

Terminal window
Get-Process |
Where-Object Name -like "*chrome*"

List:

Terminal window
Get-Service

Running services:

Terminal window
Get-Service |
Where-Object Status -eq "Running"

Use:

Terminal window
Get-CimInstance Win32_Service |
Select-Object Name, StartName, State, PathName

This is extremely useful for security assessment.

For each important service ask:

What Does It Do?
Which Account Runs It?
Where Is Its Executable?
Is It Expected?
Is It Privileged?
Who Can Modify Its Files?

Use:

Terminal window
Get-ScheduledTask

Select:

Terminal window
Get-ScheduledTask |
Select-Object TaskName, TaskPath, State

Use:

Terminal window
Get-LocalUser

Review:

Enabled
Last Logon
Description
Account Expiration

Use:

Terminal window
Get-LocalGroup

Use:

Terminal window
Get-LocalGroupMember Administrators

This is one of the most useful Windows security checks.

Ask:

WHO IS LOCAL ADMIN?
WHY?
IS ACCESS STILL REQUIRED?
IS IT A USER OR GROUP?
IS THE ASSIGNMENT TOO BROAD?

Use:

Terminal window
Get-Acl C:\Path\To\Resource

Review:

Owner
Access
Identity
Rights
Inheritance

Think:

IDENTITY
ACL
RESOURCE
READ / WRITE / MODIFY / FULL CONTROL

PowerShell exposes the Registry as a provider.

Examples:

Terminal window
Get-ChildItem HKLM:\
Terminal window
Get-ChildItem HKCU:\

Example:

Terminal window
Get-ItemProperty `
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion"

Inspect ACLs:

Terminal window
Get-Acl `
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion"

The registry can contain security-relevant configuration.

Use:

Terminal window
Get-NetIPConfiguration

or:

Terminal window
Get-NetIPAddress

Use:

Terminal window
Get-NetRoute

Use:

Terminal window
Get-DnsClientServerAddress

Use:

Terminal window
Get-NetTCPConnection

Filter listening:

Terminal window
Get-NetTCPConnection |
Where-Object State -eq "Listen"

Example:

Terminal window
Get-NetTCPConnection -State Listen |
Select-Object LocalAddress, LocalPort, OwningProcess

Then:

Terminal window
Get-Process -Id <PID>

For an authorized system:

Terminal window
Test-NetConnection `
-ComputerName <LAB_HOST> `
-Port 443

Use only approved destinations.

Use:

Terminal window
Resolve-DnsName example.com

or authorized internal lab names.

Windows event logs are extremely important for security operations.

Common logs include:

Security
System
Application
PowerShell
Microsoft Defender

Use:

Terminal window
Get-WinEvent -ListLog *

Example:

Terminal window
Get-WinEvent `
-LogName Security `
-MaxEvents 20

Access to Security logs may require appropriate privileges.

Example:

Terminal window
Get-WinEvent `
-FilterHashtable @{
LogName = "Security"
Id = 4625
} `
-MaxEvents 20

Event ID:

4625

typically represents failed logon events.

Examples:

4624
Successful Logon
4625
Failed Logon
4672
Special Privileges Assigned
4688
Process Creation
4720
User Created
4726
User Deleted
4732
Member Added to Local Group
4740
Account Locked Out
4698
Scheduled Task Created
4702
Scheduled Task Updated

Exact logging depends on system configuration.

Example:

Terminal window
$events = Get-WinEvent `
-FilterHashtable @{
LogName = "Security"
Id = 4625
} `
-MaxEvents 100

Count:

Terminal window
$events.Count

Inspect one:

Terminal window
$events[0] |
Format-List *

This helps you understand available fields before building automation.

Example:

Terminal window
$events |
Select-Object TimeCreated, Id, MachineName |
Export-Csv `
.\Reports\failed-logins.csv `
-NoTypeInformation
EVENT LOG
GET-WINEVENT
FILTER
SELECT
GROUP
EXPORT

Review PowerShell logging where enabled.

Examples may include:

Microsoft-Windows-PowerShell/Operational

List events:

Terminal window
Get-WinEvent `
-LogName "Microsoft-Windows-PowerShell/Operational" `
-MaxEvents 20

Where available:

Terminal window
Get-MpComputerStatus

Review fields such as:

Antivirus Enabled
Real-Time Protection
Signature Status

During normal security assessment:

DO NOT DISABLE DEFENDER

simply to make testing easier.

Assess the security posture without unnecessarily weakening controls.

Use:

Terminal window
Get-NetFirewallProfile

Review:

Domain
Private
Public

Use:

Terminal window
Get-NetFirewallRule

For focused reviews:

Terminal window
Get-NetFirewallRule |
Where-Object Enabled -eq "True"

Use:

Terminal window
auditpol /get /category:*

Review areas such as:

Logon
Account Management
Privilege Use
Process Creation
Policy Change

Security review may include patch posture.

Use appropriate enterprise tooling where available rather than relying only on ad hoc local commands.

Document:

Patch Governance
Update Service
Last Maintenance
Critical Missing Updates

If the host is domain joined:

Terminal window
$env:USERDOMAIN
Terminal window
$env:USERDNSDOMAIN

Use:

Terminal window
nltest /dsgetdc:<DOMAIN>

where authorized.

Basic:

Terminal window
net user /domain

If the AD module is available:

Terminal window
Get-ADUser -Filter *

Basic:

Terminal window
net group /domain

With AD module:

Terminal window
Get-ADGroup -Filter *

Use:

Terminal window
net group "Domain Admins" /domain

This is useful for identifying highly privileged membership.

If available:

Terminal window
Get-ADComputer -Filter * |
Select-Object Name, OperatingSystem

If AD module is available:

Terminal window
Get-ADUser `
-Filter {ServicePrincipalName -like "*"} `
-Properties ServicePrincipalName

Use this for authorized inventory and governance review.

Think:

USER
GROUP
PERMISSION
COMPUTER
APPLICATION
PRIVILEGE

PowerShell is useful for mapping these relationships.

Use:

Terminal window
gpresult /r

This helps identify policies applied to the current user and computer.

PowerShell allows you to automate configuration checks against approved security baselines.

Example categories:

UAC
Audit Policy
Firewall
Password Policy
Defender
Remote Administration

PowerShell supports remote administration.

Conceptually:

ADMIN
POWERSHELL REMOTING
REMOTE WINDOWS HOST

Use remoting only with explicit authorization and approved credentials.

A good automation script should:

COLLECT
VALIDATE
FILTER
NORMALIZE
REPORT

It should not make high-impact changes automatically unless the workflow explicitly requires and approves them.

Collect:

Hostname
OS
Current User
Local Administrators
Running Services
Listening Ports
Firewall State
Defender State
Terminal window
$inventory = [PSCustomObject]@{
ComputerName = $env:COMPUTERNAME
User = $env:USERNAME
Domain = $env:USERDOMAIN
}

Print:

Terminal window
$inventory

This is one of the most useful PowerShell features for reporting.

Example:

Terminal window
$result = [PSCustomObject]@{
Hostname = $env:COMPUTERNAME
Finding = "Firewall Enabled"
Status = "Pass"
}
Terminal window
$result |
Export-Csv `
.\Reports\security-check.csv `
-NoTypeInformation
Terminal window
$results = @()
$results += [PSCustomObject]@{
Check = "Firewall"
Status = "Pass"
}
$results += [PSCustomObject]@{
Check = "Defender"
Status = "Review"
}
Terminal window
$results |
Where-Object Status -eq "Review"

PowerShell can convert objects:

Terminal window
$results |
ConvertTo-Html |
Out-File .\Reports\report.html

This is useful for simple internal reports.

Use:

Terminal window
try {
Get-Content .\security.log -ErrorAction Stop
}
catch {
Write-Output "Unable to read security.log"
}

Some PowerShell errors are non-terminating.

Using:

Terminal window
-ErrorAction Stop

can allow try/catch to handle them consistently.

Example:

Terminal window
try {
Write-Output "Processing"
}
catch {
Write-Output "Error"
}
finally {
Write-Output "Cleanup"
}

Useful when cleanup must always happen.

Example:

Terminal window
function Write-SecurityLog {
param(
[string]$Message
)
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
"$timestamp $Message" |
Out-File `
.\Reports\script.log `
-Append
}

Avoid writing:

Passwords
Access Tokens
Private Keys
Complete Session Tokens

into script logs.

Example:

Terminal window
param(
[string]$ComputerName
)

Run:

Terminal window
.\security-check.ps1 `
-ComputerName APP01

Example:

Terminal window
param(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$LogPath
)

PowerShell supports many validation attributes.

Example:

Terminal window
param(
[ValidateSet(
"Low",
"Medium",
"High",
"Critical"
)]
[string]$Severity
)

A good PowerShell script may contain:

PARAMETERS
CONFIGURATION
FUNCTIONS
COLLECTION
ANALYSIS
OUTPUT
ERROR HANDLING
CLEANUP

Avoid:

Hard-Coded Secrets
Unvalidated Input
Excessive Privilege
Unsafe Dynamic Command Construction
Unnecessary Remote Execution
Sensitive Logging

Treat features such as dynamically evaluating command strings with caution.

Prefer:

NATIVE CMDLETS
PARAMETERS
OBJECT PIPELINES

instead of interpreting untrusted input as executable code.

Do not automatically launch PowerShell as Administrator.

Ask:

WHICH COMMAND
ACTUALLY REQUIRES
ELEVATED ACCESS?

Run standard-user workflows as a standard user whenever possible.

View:

Terminal window
Get-ExecutionPolicy

Execution policy is a script-execution safety feature, not a complete security boundary.

Do not weaken policy merely to run unknown code.

In managed environments, scripts may be signed to provide:

AUTHOR VERIFICATION
INTEGRITY
TRUST MANAGEMENT

This can support enterprise automation governance.

PowerShell can support session transcription in managed environments.

This can help organizations capture:

ADMINISTRATIVE ACTIVITY
SCRIPT EXECUTION
INVESTIGATION CONTEXT

according to organizational policy.

Organizations should consider:

PowerShell Operational Logs
Script Block Logging
Module Logging
Process Creation
EDR Telemetry

where appropriate.

115 — Project 01: Local Administrator Audit

Section titled “115 — Project 01: Local Administrator Audit”

Create a script that:

GETS HOSTNAME
COLLECTS LOCAL ADMINISTRATORS
IDENTIFIES USERS / GROUPS
EXPORTS CSV

Example base command:

Terminal window
Get-LocalGroupMember Administrators

116 — Project 02: Windows Service Inventory

Section titled “116 — Project 02: Windows Service Inventory”

Collect:

Service Name
State
Startup Type
Service Identity
Executable Path

Use:

Terminal window
Get-CimInstance Win32_Service

Build:

SECURITY LOG
EVENT 4625
EXTRACT EVENTS
COUNT
GROUP
REPORT

118 — Project 04: Defender Status Report

Section titled “118 — Project 04: Defender Status Report”

Collect:

Host
Antivirus State
Real-Time Protection
Signature State
Timestamp

using approved Defender cmdlets.

119 — Project 05: Windows Firewall Audit

Section titled “119 — Project 05: Windows Firewall Audit”

Collect:

Profile
Enabled
Default Inbound
Default Outbound

Then export a report.

120 — Project 06: Windows Security Inventory

Section titled “120 — Project 06: Windows Security Inventory”

Combine:

SYSTEM INFO
LOCAL ADMINS
SERVICES
PORTS
FIREWALL
DEFENDER
AUDIT POLICY

into a single security inventory.

Allow the analyst to specify:

Log Name
Event ID
Time Range
Maximum Events
Output File

Then export structured evidence.

122 — Project 08: Active Directory Inventory

Section titled “122 — Project 08: Active Directory Inventory”

In an authorized domain lab, collect:

Users
Groups
Computers
Privileged Groups
Service Accounts

and export sanitized reports.

Use:

Terminal window
Get-FileHash

Example:

Terminal window
Get-FileHash .\sample.txt -Algorithm SHA256

For collected evidence:

Terminal window
Get-FileHash `
.\Evidence\security.evtx `
-Algorithm SHA256

Record the hash alongside evidence metadata.

125 — Project 10: Security Configuration Checker

Section titled “125 — Project 10: Security Configuration Checker”

Create checks for:

Firewall
Defender
Local Administrators
Audit Policy
Selected Services

Return:

PASS
REVIEW
FAIL

based on a documented training baseline.

Focus on:

Get-WinEvent
Where-Object
Group-Object
Select-Object
Export-Csv
JSON

127 — PowerShell for Incident Responders

Section titled “127 — PowerShell for Incident Responders”

Focus on:

Processes
Services
Network Connections
Event Logs
Files
Hashes
Users
Scheduled Tasks

128 — PowerShell for Windows Security Engineers

Section titled “128 — PowerShell for Windows Security Engineers”

Focus on:

Users
Groups
Services
Firewall
Defender
Registry
Audit Policy
Configuration Baselines

129 — PowerShell for Active Directory Security

Section titled “129 — PowerShell for Active Directory Security”

Focus on:

Users
Groups
Computers
Service Accounts
Group Membership
Administrative Relationships
GPO Context

PowerShell also supports Microsoft cloud ecosystems through dedicated modules.

Common security workflows can include:

IDENTITY INVENTORY
ROLE REVIEW
RESOURCE CONFIGURATION
SECURITY EVENTS
POLICY CHECKS

Use approved modules and authorized environments.

A simple mental model:

BASH
=
LINUX + TEXT PIPELINES
POWERSHELL
=
WINDOWS + OBJECT PIPELINES

Use PowerShell when:

Working Deeply With Windows
Managing Microsoft Services
Querying Windows Objects
Using Native Windows APIs / Modules

Use Python when:

Cross-Platform Automation
Complex Data Processing
General APIs
Larger Security Applications

Often both are useful.

Always consider:

WHO RUNS THE SCRIPT?
WHAT PRIVILEGE DOES IT HAVE?
WHAT SYSTEMS DOES IT TOUCH?
WHAT DATA DOES IT READ?
WHAT DATA DOES IT WRITE?
WHAT DOES IT LOG?
WHAT HAPPENS IF IT FAILS?

Before executing an unfamiliar script:

READ IT
UNDERSTAND PARAMETERS
CHECK NETWORK CALLS
CHECK FILE OPERATIONS
CHECK REGISTRY OPERATIONS
CHECK PRIVILEGE REQUIREMENTS
CHECK CLEANUP

Do not run unknown scripts as Administrator.

Week Focus
1 Cmdlets, Objects, Pipeline, Variables
2 Files, Processes, Services, Users, Groups
3 Event Logs, Registry, Networking, AD
4 Security Automation Project

You understand:

Cmdlets
Objects
Pipeline
Variables

You can use:

Where-Object
Select-Object
Sort-Object
Group-Object

You can review:

Users
Groups
Processes
Services
Firewall
Defender

You can:

Query Event Logs
Filter Event IDs
Export Evidence
Summarize Events

You can:

Inventory Users
Review Groups
Inventory Computers
Review Service Accounts

in authorized environments.

You can build:

Inventory Scripts
Audit Scripts
Log Analysis Scripts
Evidence Collection Scripts
Security Reports
  • PowerShell version identified
  • Cmdlets understood
  • Help system understood
  • Objects understood
  • Pipeline understood
  • Variables
  • Arrays
  • Hashtables
  • Conditions
  • Loops
  • Functions
  • Parameters
  • Get-ChildItem
  • Get-Content
  • Select-String
  • Out-File
  • CSV
  • JSON
  • File hashes
  • Current identity
  • System information
  • Processes
  • Services
  • Scheduled tasks
  • Local users
  • Local groups
  • Local administrators
  • Get-Acl understood
  • File ACLs reviewed
  • Registry ACLs reviewed
  • Ownership understood
  • Get-WinEvent
  • Security log
  • Event ID filtering
  • PowerShell logs
  • Event exporting
  • IP configuration
  • Routes
  • DNS
  • TCP connections
  • Connectivity testing
  • Defender status
  • Firewall profiles
  • Audit policy
  • Security controls left enabled
  • Domain context
  • Domain controller discovery
  • Users
  • Groups
  • Domain Admins
  • Computers
  • Service accounts
  • GPO context
  • Inputs validated
  • Errors handled
  • Secrets protected
  • Logs sanitized
  • Least privilege used
  • Unknown scripts reviewed
  • Cleanup included
  • Local administrator audit
  • Service inventory
  • Failed login analyzer
  • Defender status report
  • Firewall audit
  • Security inventory
  • Event exporter
  • AD inventory
  • File hash collection
  • Configuration checker

40 PowerShell for Cybersecurity Review Questions

Section titled “40 PowerShell for Cybersecurity Review Questions”
  1. What is PowerShell?
  2. Why is PowerShell important for Windows security?
  3. What is a cmdlet?
  4. What does Verb-Noun mean?
  5. What is a PowerShell object?
  6. How is PowerShell’s pipeline different from a text-only shell?
  7. What does Get-Member show?
  8. What does Where-Object do?
  9. What does Select-Object do?
  10. What does Sort-Object do?
  11. What does Group-Object do?
  12. What is a PowerShell array?
  13. What is a hashtable?
  14. What is a PSCustomObject?
  15. Why are PSCustomObjects useful in reporting?
  16. What does Get-Process provide?
  17. What does Get-Service provide?
  18. Why is Get-CimInstance Win32_Service useful?
  19. What does Get-LocalUser provide?
  20. Why should local Administrators membership be reviewed?
  21. What does Get-Acl provide?
  22. Why are ACLs important in security assessments?
  23. How does PowerShell access the Windows Registry?
  24. What does Get-NetTCPConnection provide?
  25. What does Test-NetConnection do?
  26. What is Get-WinEvent used for?
  27. What does event ID 4625 commonly represent?
  28. What does event ID 4624 commonly represent?
  29. Why is PowerShell logging valuable for defenders?
  30. What does Get-MpComputerStatus provide?
  31. Why should Defender not be disabled during normal security testing?
  32. What does Get-NetFirewallProfile show?
  33. What is Active Directory?
  34. How can PowerShell help inventory AD users and groups?
  35. Why are service accounts important?
  36. What does gpresult /r provide?
  37. Why should PowerShell automation run with least privilege?
  38. Why should dynamic code execution be treated carefully?
  39. Why should scripts avoid hard-coded secrets?
  40. What makes a PowerShell security script repeatable and professional?

Final PowerShell for Cybersecurity Mental Model

Section titled “Final PowerShell for Cybersecurity Mental Model”

Remember:

WINDOWS SECURITY DATA
POWERSHELL CMDLET
OBJECT
PIPELINE
FILTER
SELECT
ANALYZE
EXPORT
SECURITY DECISION

For automation:

COLLECT
VALIDATE
NORMALIZE
ANALYZE
REPORT
REVIEW

Do not think:

I NEED TO MEMORIZE
EVERY POWERSHELL CMDLET

Think:

WHAT WINDOWS OBJECT
DO I NEED?
WHICH CMDLET
RETURNS IT?
WHICH PROPERTY
MATTERS?
HOW DO I FILTER IT?
HOW DO I TURN IT
INTO A SECURITY RESULT?

For example:

WINDOWS HOST
Get-LocalGroupMember
ADMINISTRATORS
REVIEW MEMBERSHIP
SECURITY FINDING

or:

SECURITY EVENT LOG
Get-WinEvent
FILTER EVENT ID
GROUP EVENTS
INVESTIGATION SUMMARY

or:

ACTIVE DIRECTORY
USERS + GROUPS
PRIVILEGE RELATIONSHIPS
SECURITY REVIEW

That is PowerShell for cybersecurity:

WINDOWS OBJECTS
+
SECURITY CONTEXT
+
AUTOMATION
=
REPEATABLE SECURITY OPERATIONS

➡️ 04 — JavaScript Fundamentals

The next module moves into the language that powers much of the modern browser and frontend application ecosystem.

You will learn:

JAVASCRIPT BASICS
VARIABLES
DATA TYPES
FUNCTIONS
ARRAYS
OBJECTS
CONDITIONS
LOOPS
DOM
EVENTS
BROWSER STORAGE
HTTP REQUESTS
JSON
ASYNC JAVASCRIPT
WEB SECURITY CONTEXT

The goal is not to become a frontend developer.

The goal is to understand enough JavaScript to analyze modern web application behavior, client-side logic, API interactions, browser security boundaries, and application security workflows.