Why This List Exists
Azure Portal is great until:
- RDP is slow
- You need to fix networking
- Active Directory breaks
- You're troubleshooting 50 VMs
Then you need actual Windows commands.
Network Troubleshooting
Check IP Configuration
Get-NetIPAddress | Format-Table InterfaceAlias, IPAddress, PrefixLength
Test DNS Resolution
Resolve-DnsName azure-noob.com -Server 8.8.8.8
Trace Route to Endpoint
tracert 10.0.1.4
Check Open Ports
Test-NetConnection -ComputerName 10.0.1.4 -Port 443
Show Routing Table
route print
Flush DNS Cache
ipconfig /flushdns
Show Active Connections
netstat -ano | findstr ESTABLISHED
Active Directory Commands
Join Domain
Add-Computer -DomainName contoso.com -Credential (Get-Credential) -Restart
Verify Domain Join
nltest /dsgetdc:contoso.com
Check AD Replication
repadmin /replsummary
Find Domain Controllers
Get-ADDomainController -Filter * | Select Name, IPv4Address
Reset Computer Account
Reset-ComputerMachinePassword -Server DC01 -Credential (Get-Credential)
Test Domain Trust
nltest /sc_query:contoso.com
Disk Management
List All Disks
Get-Disk | Format-Table Number, FriendlyName, Size, PartitionStyle
Initialize New Disk
Initialize-Disk -Number 2 -PartitionStyle GPT
Create New Partition
New-Partition -DiskNumber 2 -UseMaximumSize -DriveLetter F
Format-Volume -DriveLetter F -FileSystem NTFS -NewFileSystemLabel "Data"
Extend Volume
Resize-Partition -DriveLetter C -Size (Get-PartitionSupportedSize -DriveLetter C).SizeMax
Check Disk Health
Get-PhysicalDisk | Select FriendlyName, HealthStatus, OperationalStatus
Service Management
List All Services
Get-Service | Where-Object {$_.Status -eq "Running"} | Format-Table Name, DisplayName
Start/Stop Service
Start-Service -Name "W32Time"
Stop-Service -Name "Spooler"
Set Service Startup Type
Set-Service -Name "wuauserv" -StartupType Manual
Check Service Dependencies
Get-Service -Name "W32Time" | Select -ExpandProperty DependentServices
Performance & Monitoring
Check CPU Usage
Get-Counter '\Processor(_Total)\% Processor Time' -SampleInterval 1 -MaxSamples 5
Check Memory Usage
Get-WmiObject Win32_OperatingSystem |
Select @{N="FreeGB";E={[math]::Round($_.FreePhysicalMemory/1MB,2)}}
Show Top CPU Processes
Get-Process | Sort-Object CPU -Descending | Select -First 10 Name, CPU, PM
Check Disk I/O
Get-Counter '\PhysicalDisk(_Total)\Disk Reads/sec','\PhysicalDisk(_Total)\Disk Writes/sec'
Show Uptime
(Get-Date) - (gcim Win32_OperatingSystem).LastBootUpTime
Windows Updates
Check for Updates
Get-WindowsUpdate
Install Updates
Install-WindowsUpdate -AcceptAll -AutoReboot
Show Update History
Get-WmiObject -Class Win32_QuickFixEngineering | Select HotFixID, InstalledOn
User & Permission Management
List Local Admins
Get-LocalGroupMember -Group "Administrators"
Add User to Local Admin
Add-LocalGroupMember -Group "Administrators" -Member "CONTOSO\john.doe"
Show Logged-in Users
query user
Force Logoff User
logoff 2 /server:localhost
Check File Permissions
Get-Acl C:\Important\File.txt | Format-List
Firewall Management
Show Firewall Rules
Get-NetFirewallRule | Where Enabled -eq True | Select Name, DisplayName
Create Firewall Rule
New-NetFirewallRule -DisplayName "Allow SQL" -Direction Inbound -Protocol TCP -LocalPort 1433 -Action Allow
Disable Firewall (Testing Only!)
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False
Event Log Analysis
Show Recent Errors
Get-EventLog -LogName System -EntryType Error -Newest 20
Search Event Logs
Get-EventLog -LogName Application | Where-Object {$_.Message -like "*SQL*"}
Show Security Events
Get-EventLog -LogName Security -InstanceId 4624 -Newest 10
Azure-Specific Commands
Check Azure VM Agent
Get-Service WindowsAzureGuestAgent
Test Azure Metadata Service
Invoke-RestMethod -Headers @{"Metadata"="true"} -Method GET -Uri "http://169.254.169.254/metadata/instance?api-version=2021-02-01"
Show Azure VM Extensions
Get-AzVMExtension -ResourceGroupName "RG-Prod" -VMName "VM-SQL-01"
System Information
Show OS Version
Get-ComputerInfo | Select WindowsProductName, WindowsVersion, OsBuildNumber
Show Installed Programs
Get-WmiObject -Class Win32_Product | Select Name, Version
Check System Drivers
Get-WindowsDriver -Online
Show Environment Variables
set
Quick Fixes
Reset Windows Update
net stop wuauserv
del C:\Windows\SoftwareDistribution\*.* /s /q
net start wuauserv
Clear Temp Files
Remove-Item -Path "$env:TEMP\*" -Recurse -Force -ErrorAction SilentlyContinue
Rebuild Windows Search Index
Get-Service WSearch | Restart-Service
Full Command Reference
Complete command library with parameters, examples, and troubleshooting guides:
👉 50 Windows Commands Complete Guide
Managing Azure VMs? Bookmark this. The Azure Portal can't do everything—sometimes you need actual Windows commands.
Top comments (0)