Windows Admin Commands for Developers and DBAs

CMD and PowerShell checks for Windows hosts. Last updated August 28, 2026.

Windows troubleshooting gets cleaner when CMD is used for legacy checks and PowerShell is used for structured inspection. A DBA should be able to prove host identity, service state, ports, disk pressure and recent errors before changing an application or database.

Host identity

hostname
whoami
ver
ipconfig /all
$PSVersionTable.PSVersion
Get-ComputerInfo | Select-Object OsName, OsVersion, CsName
Get-Date -Format o
Get-Location

Services and database processes

Use service state before restarting anything. Look for SQL Server, PostgreSQL, MySQL, Oracle, web server and queue worker services.

Get-Service | Where-Object {$_.Name -match 'sql|postgres|mysql|oracle|iis|nginx|apache'} | Sort-Object Status, Name
Get-Process | Sort-Object CPU -Descending | Select-Object -First 15
tasklist | findstr /i "sql postgres mysql oracle"

DNS and port reachability

PowerShell's Test-NetConnection helps separate DNS, route and blocked-port issues.

Resolve-DnsName formalint.com
Test-NetConnection formalint.com -Port 443
Test-NetConnection db.example.internal -Port 1433
Test-NetConnection db.example.internal -Port 5432
netstat -ano | findstr LISTENING

Disk and filesystem pressure

Get-Volume
Get-PSDrive -PSProvider FileSystem
Get-ChildItem C:\ -Directory | Sort-Object LastWriteTime -Descending | Select-Object -First 20

Event logs

Event logs help confirm whether a failure is a service crash, login problem, disk warning, driver issue or application error.

Get-EventLog -LogName Application -Newest 80
Get-EventLog -LogName System -EntryType Error,Warning -Newest 80
Get-WinEvent -LogName Application -MaxEvents 50 | Select-Object TimeCreated, ProviderName, Id, LevelDisplayName, Message

DBA handoff checklist

  1. Record host, Windows version, user and timestamp.
  2. Record database service status and recent log errors.
  3. Check disk volume health and backup destination space.
  4. Check port reachability from the application host.
  5. Attach commands and outputs to the incident note after removing secrets.

Prefer read-only commands first. Restarting a database service should be a deliberate change, not the first diagnostic step.

Related: Terminal Workflows, DBA Admin Roadmap, Hardware Diagnostics.