25 practical automations

System monitoring

See what is happening on your computer. Each guide includes full code, usage instructions, and ideas for making it your own.

Search this category ↗
PowerShellBeginner

Adapter error counters

Read cumulative network-adapter packet errors and discards.

System monitoring
PowerShellBeginner

Battery charge

Show reported battery charge, runtime estimate, and status.

System monitoring
PowerShellBeginner

Bounded ICMP latency

Send a fixed small number of connectivity checks to one selected host.

System monitoring
PowerShellBeginner

Check one HTTP endpoint

Measure one bounded HEAD request status and response time.

System monitoring
PowerShellBeginner

CPU utilization

Read CPU busy and privileged percentages per logical processor.

System monitoring
PowerShellBeginner

Defender health

Read antivirus protection and signature timestamps without running a scan.

System monitoring
PowerShellBeginner

Disk throughput

Read per-disk transfer rates and queue length.

System monitoring
PowerShellBeginner

DNS lookup

Resolve one selected hostname and inspect its answers.

System monitoring
PowerShellBeginner

Event error counts

Aggregate recent critical and error events by provider.

System monitoring
PowerShellBeginner

Failed logon counts

Count Security event 4625 by hour without printing accounts or addresses.

System monitoring
PowerShellBeginner

Listening processes

Join local listening TCP sockets to their owning process names.

System monitoring
PowerShellBeginner

Low disk space

Flag mounted drive-letter volumes below a free-space threshold.

System monitoring
PowerShellBeginner

Measure process CPU activity

Measure CPU-time increases over an interval and normalize by machine CPU count.

System monitoring
PowerShellBeginner

Memory-heavy processes

Rank processes by resident working-set memory and show private memory.

System monitoring
PowerShellBeginner

Network throughput

Read received and sent byte rates for network interfaces.

System monitoring
PowerShellBeginner

Pagefile usage

Compare allocated, current, and peak pagefile usage in MiB.

System monitoring
PowerShellBeginner

Physical memory pressure

Compute available physical memory and warn below a selected percentage.

System monitoring
PowerShellBeginner

Print queues

Collect pending print-job state and age without cancelling jobs.

System monitoring
PowerShellBeginner

Process handle counts

Rank processes by current operating-system handle count.

System monitoring
PowerShellBeginner

Required services

Check a list of required service names without starting them.

System monitoring
PowerShellBeginner

Restart history

Read planned-restart and unexpected-shutdown records.

System monitoring
PowerShellBeginner

System uptime

Show the boot timestamp and elapsed uptime.

System monitoring
PowerShellBeginner

TCP state counts

Summarize local sockets by connection state.

System monitoring