Windows Powershell Forensics

System Information and Metadata Collection

Get-SystemInfo: Retrieves detailed system information.
Get-ComputerInfo : 
Get-WmiObject -Class Win32_OperatingSystem : Gather information about the Operating System
Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* : Retrieve Installed Software
(Get-WmiObject -Class Win32_OperatingSystem).LastBootUpTime : Check System Boot Time
Get-ChildItem env:\  : to get all Environment Variables
dir env:\

User Activity and Login Tracking

quser : List Active User Sessions 
Get-LocalUser : Retrieve Local User Accounts
Get-EventLog -LogName Security | Where-Object {$_.EventID -eq 4624} : 

Network Information

Get-NetTCPConnection : List Active Network Connections
Get-NetIPAddress : Retrieve IP Address Information 
Get-SmbShare : List Active Network Shares 

Get-NetTCPConnection | Where-Object { $_.RemoteAddress -notlike "127.*" -and $_.RemoteAddress -notlike "::1" } : List Only Foreign (External) Network Connections

Get-NetTCPConnection | Where-Object { $_.RemotePort -eq 443 -or $_.RemoteAddress -match "^192\.168\." } : Filter Connections by Specific Port or IP Range

Get-NetTCPConnection -State Established : Find Established Network Connections 

Process and Service Monitoring

Functionality
PowerShell
Command

List processes

Get-Process

wmic.exe process

Network connections

Get-NetTCPConnection

netstat.exe -nao

Registry access

Get-ChildItem

reg.exe

List services

Get-Service

sc.exe query

List users

Get-LocalUser

net.exe user

List groups

Get-LocalGroup

net.exe localgroup

List scheduled tasks

Get-ScheduledTask

schtasks.exe

Access Event Logs

Get-WinEvent

wevtutil.exe

Inspecting Loaded Modules and DLLs for Process Analysis

File System and Registry Analysis

Event Log Analysis

History

Browser and Internet Activity

Collecting Evidence

Malware Detection and Analysis

Using Hashing for File Integrity Verification

Using WMI and CIM for Deeper System Insights

PowerShell Commands to Discover WMI Events

Unusual Accounts

Unusual Log Entries

Last updated