Windows/PowerShell/Common Tools

From r00tedvw.com wiki
Jump to: navigation, search

Below are some common tools for Powershell 7 Core with a focus on system administration.

Contents

Show open ports

PS /> Get-NetTCPConnection
PS /> Get-NetTCPConnection | Where-Object { $_.State -eq 'Listen' }

Process List

PS /> Get-Process
PS /> Get-Process | Sort-Object CPU -Descending | Format-Table -Property Name, CPU, Id, MemoryUsage -AutoSize
PS /> while ($true) { Get-Process | Sort-Object CPU -Descending | Format-Table -Property Name, CPU, Id, MemoryUsage -AutoSize; Start-Sleep -Seconds 1 }

Disk Space

PS /> Get-PSDrive -PSProvider FileSystem
PS /> Get-Volume

CPU Usage

PS /> Get-Counter -Counter "\Processor(_Total)\% Processor Time"
PS /> Get-Counter -Counter "\Processor(_Total)\% Processor Time" -Continuous

Network Utilization

PS /> Get-NetAdapterStatistics
PS /> Get-Counter -Counter "\Network Interface(*)\Bytes Total/sec"
PS /> Get-Counter -Counter "\Network Interface(*)\Bytes Total/sec" -Continuous

Uptime

PS /> $uptime = (Get-Date) - (Get-CimInstance -ClassName Win32_OperatingSystem).LastBootUpTime
PS />$uptime

Memory Usage

PS /> Get-PhysicalMemory
PS /> Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object TotalVisibleMemorySize, FreePhysicalMemory

List Installed Software

PS /> Get-CimInstance -ClassName Win32_Product | Select-Object Name, Version
PS /> Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion

Check System Updates

PS /> Install-Module -Name PSWindowsUpdate -Force -SkipPublisherCheck
PS /> Get-WindowsUpdate

Get System Info

PS /> Get-ComputerInfo
PS /> (Get-ComputerInfo).OsArchitecture

Check Active Users Sessions

PS /> quser

Show Event Logs

PS /> Get-EventLog -LogName System -Newest 10

List Scheduled Tasks

PS /> Get-ScheduledTask
Personal tools
Namespaces

Variants
Actions
Navigation
Mediawiki
Confluence
DevOps Tools
Open Source Products
Ubuntu
Ubuntu 22
Mac OSX
Oracle Linux
AWS
Windows
OpenVPN
Grafana
InfluxDB2
TrueNas
MagicMirror
OwnCloud
Pivotal
osTicket
OTRS
phpBB
WordPress
VmWare ESXI 5.1
Crypto currencies
HTML
CSS
Python
Java Script
PHP
Raspberry Pi
Canvas LMS
Kaltura Media Server
Plex Media Server
MetaSploit
Zoneminder
ShinobiCE
Photoshop CS2
Fortinet
Uploaded
Certifications
General Info
Games
Meal Plans
NC Statutes
Politics
Volkswagen
Covid
NCDMV
Toolbox