Author: Juniya Sankara
Date: 2025-08-13T22:00:00+00:00
Keywords: Commands; Windows; Microsoft; Windows Server
Description: This PDF was created for free by WindowsMode.com - Visit our site for more downloads like software and games we recommend and yes, more Windows Cheat Sheets!
Publisher: WindowsMode.com

Created by WindowsMode.com Official

Windows Server 2025 Command Cheat Sheet

– Download more cheat sheets for your Windows computer –

Tip: Use an elevated terminal (Run as administrator) for system‐level commands. Some cmdlets require their feature/role or RSAT module to be installed.

System info & management

Command Description
systeminfo Show detailed OS, patch, and hardware information.

hostname Display computer name.

wmic os get caption,version,buildnumber Quick OS caption/build (WMIC may be deprecated; use PowerShell alternatives).

Get-ComputerInfo Comprehensive system info (PowerShell).

slmgr /dlv Show detailed licensing status.

sconfig Server Core configuration menu (also available on 2025 for quick setup).

rename-computer -newname SRV-FILE01 - Rename server and reboot (PowerShell).

restart
tzutil /s "South Africa Standard Time" Set time zone.

date /t & time /t Show current date and time.

Get-Uptime Display system uptime (PowerShell 7+), or (get-date) - (gcim
win32_operatingsystem).lastbootuptime .

File & directory

Command Description
dir /a List directory contents (including hidden/system).

tree /f Display folder structure including files.

copy file.txt D:\Backup\ Copy file to destination.

xcopy C:\Src D:\Dst /E /H /C /I /Y Copy directories recursively, keep attributes, continue on errors.

robocopy C:\Src D:\Dst /MIR /R:1 /W:1 /MT:16 /LOG:rc.log Mirror directories with multi-threading and logging.

del /f /q *.log Force delete quietly.

icacls C:\Data /inheritance:d /grant "Domain Admins":F /t Set NTFS permissions (disable inheritance, grant Full control recursively).

takeown /f C:\Data /r /d y Take ownership recursively.

compact /c /s:C:\Data Enable NTFS compression.

cipher /w:C:\Temp Securely wipe free space in folder/volume.

mklink /d C:\Link D:\Target Create directory symbolic link.

Networking

Command Description
ipconfig /all Full IP configuration.

Get-NetIPConfiguration PowerShell view of adapters.

New-NetIPAddress -InterfaceAlias "Ethernet" -IPAddress 10.0.0.10 -PrefixLength 24 -DefaultGateway Assign static IP.

10.0.0.1

Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses 10.0.0.5,10.0.0.6 Set DNS servers.

ping 8.8.8.8 -n 5 Test connectivity.

tracert microsoft.com Trace route to host.

pathping 10.0.0.1 Trace + packet loss
diagnostics.

netstat -ano Active connections with PIDs.

Get-NetTCPConnection | Sort-Object -Property State, LocalPort | ft -AutoSize PowerShell connections view.

arp -a ARP table.

route print Show routing table.

Firewall

Command Description
netsh advfirewall set allprofiles state on Enable firewall all profiles.

New-NetFirewallRule -DisplayName "Allow HTTP" -Direction Inbound -Action Allow -Protocol TCP - Create allow rule

LocalPort 80 (PowerShell).

netsh advfirewall firewall add rule name="Allow RDP" dir=in action=allow protocol=TCP Allow RDP inbound.

localport=3389

Get-NetFirewallProfile | Format-Table Name, Enabled List profile states.

Set-NetFirewallProfile -Profile Domain,Public,Private -DefaultInboundAction Block - Harden defaults.

DefaultOutboundAction Allow

Users & security

Command Description
net user List local users.

net user svc-backup Str0ngP@ss! /add Create local user.

net localgroup administrators svc-backup /add Add user to local group.

secedit /export /cfg C:\secpol.inf Export local security policy.

whoami /groups Show current user and group SIDs.

runas /user:DOMAIN\Admin cmd Run a program as another user.

auditpol /get /category:* View audit policy.

auditpol /set /subcategory:"Logon" /success:enable /failure:enable Enable logon auditing.

Active Directory

Requires AD DS role or RSAT tools.

Command Description

Install-WindowsFeature AD-Domain-Services -IncludeManagementTools Install AD DS role.

Install-ADDSForest -DomainName corp.local -DomainNetbiosName CORP -SafeModeAdministratorPassword Create new forest.

(Read-Host -AsSecureString)

djoin /provision /domain corp.local /machine SRV-APP01 /savefile C:\djoin.blob Offline domain join

(provision).

djoin /requestODJ /loadfile C:\djoin.blob /windowspath C:\Windows /localos Apply offline domain join.

netdom join SRV-APP01 /domain:corp.local /userd:admin /passwordd:* Join domain online.

Get-ADUser -Filter "Surname -like 'M*'" | Select Name, SamAccountName Query users (PowerShell

AD module).

New-ADUser "Alice Martin" -SamAccountName amartin -Path "OU=Users,DC=corp,DC=local" -Enabled $true Create user.

-AccountPassword (Read-Host -AsSecureString)

dsquery computer -name SRV* Find computers (legacy DS
tools).

nltest /dsgetdc:corp.local Find a domain controller.

Group Policy

Command Description
gpupdate /force Refresh GPOs immediately.

gpresult /r /scope computer Resultant set of policy (computer).

gpresult /h C:\gp.html Generate HTML report.

Get-GPO -All | Select DisplayName, Id List GPOs (PowerShell GPMC module).

Get-GPResultantSetOfPolicy -ReportType Html -Path C:\rsop.html Create RSOP report.

Roles & features

Command Description

Get-WindowsFeature List available roles/features.

Install-WindowsFeature Web-Server -IncludeManagementTools Install IIS.

Uninstall-WindowsFeature Web-Server Remove role/feature.

dism /online /get-features /format:table List optional features (DISM).

dism /online /enable-feature /featurename:NetFx3 /all Enable .NET Framework 3.5 (if source available).

Services

Command Description
sc query type= service state= all List services (SCM).

Get-Service | Sort Status, Name List services (PowerShell).

sc config Spooler start= disabled Change start type.

Stop-Service -Name W32Time -Force Stop service.

Start-Service -Name W32Time Start service.

Restart-Service -Name dnscache Restart service.

Processes & performance

Command Description
tasklist List running processes.

taskkill /PID 1234 /F Kill process by PID.

Get-Process | Sort-Object CPU -desc | Select -First 10 Name, CPU, Id Top CPU processes.

typeperf "\Processor(_Total)\% Processor Time" -sc 5 Sample CPU performance counters.

Get-Counter '\Memory\Available MBytes' Read memory counter.

resmon Open Resource Monitor (GUI).

Storage, volumes & DFS

Command Description
diskpart Disk partitioning utility.

Get-Disk List disks (PowerShell Storage).

Initialize-Disk -Number 2 -PartitionStyle GPT Initialize new disk.

New-Partition -DiskNumber 2 -UseMaximumSize -AssignDriveLetter Create partition.

Format-Volume -DriveLetter E -FileSystem NTFS -NewFileSystemLabel Data -Confirm:$false Format volume.

Get-Volume List volumes.

chkdsk E: /scan Online scan volume.

fsutil volume diskfree E: Free/total bytes.

dfsrdiag backlog /rgname:RG1 /rfname:Data /sendingmember:SRV1 /receivingmember:SRV2 DFS-R backlog (if DFSR installed).

SMB & shares

Command Description

New-SmbShare -Name Data -Path C:\Data -FullAccess "CORP\Domain Admins" Create SMB share.

Get-SmbShare List shares.

Set-SmbServerConfiguration -EnableSMB1Protocol $false -Force Disable SMBv1 for security.

net share Legacy share listing.

IIS & web

Command Description

Install-WindowsFeature Web-Server -IncludeManagementTools Install IIS role.

%SystemRoot%\System32\inetsrv\appcmd list site List IIS sites.

%SystemRoot%\System32\inetsrv\appcmd add site /name:"Site1" Create site.

/bindings:http/*:80:site1.corp.local /physicalPath:"C:\Sites\Site1"

iisreset Restart IIS services.

Get-WebBinding List bindings (WebAdministration
module).

Hyper‐V

Command Description

Install-WindowsFeature Hyper-V -IncludeManagementTools -Restart Install Hyper‐V.

Get-VM List VMs.

New-VM -Name DC01 -MemoryStartupBytes 4GB -Generation 2 -SwitchName "vSwitch" Create VM.

Set-VM -Name DC01 -ProcessorCount 4 Adjust vCPU.

Start-VM DC01 Start VM.

Checkpoint-VM DC01 -SnapshotName "PrePatch" Create checkpoint.

Export-VM DC01 -Path D:\VMExports Export VM.

Backup & recovery

Command Description
wbadmin enable backup -addtarget:E: -schedule:21:00 -include:C: -allCritical -quiet Enable nightly backup
to E:.

wbadmin start backup -backupTarget:E: -include:C: -allCritical -quiet Run backup now.

wbadmin get versions List available backups.

wbadmin start recovery -version:MM/DD/YYYY-HH:MM -itemType:File -items:C:\Data\report.xlsx - File recovery.

recoveryTarget:C:\Restore -quiet

Updates

For Server Core, use sconfig option 6. PowerShell module PSWindowsUpdate can provide advanced control (install via PowerShell Gallery).

Command Description
sconfig Interactive updates (Core).

Install-PackageProvider -Name NuGet -Force Prep for PowerShell Gallery.

Set-PSRepository -Name PSGallery -InstallationPolicy Trusted Trust gallery.

Install-Module PSWindowsUpdate -Force Install update module.

Get-WindowsUpdate List available updates (PSWindowsUpdate).

Install-WindowsUpdate -AcceptAll -AutoReboot Install and reboot if needed.

Logs & auditing

Command Description
eventvwr.msc Open Event Viewer.

wevtutil qe System /c:20 /rd:true /f:text Tail last 20 System events.

Get-WinEvent -LogName Security -MaxEvents 50 | ft TimeCreated, Id, LevelDisplayName, Message - Read Security log (PowerShell).

Auto
auditpol /get /category:* View audit config.

logman query List performance data
collectors.

Scheduled tasks

Command Description
schtasks /query /fo LIST /v List tasks verbosely.

schtasks /create /sc daily /st 23:00 /tn "NightlyBackup" /tr "wbadmin start backup -backupTarget:E: - Create daily backup
include:C: -allCritical -quiet" /ru "SYSTEM" task.

Unregister-ScheduledTask -TaskName NightlyBackup -Confirm:$false Delete task

(PowerShell).

Get-ScheduledTask | ? TaskName -like "*Update*" Filter tasks.

Remote admin

Command Description
mstsc /v:SRV-CORE01 Remote Desktop client.

Enable-PSRemoting -Force Enable WinRM for PowerShell remoting.

Enter-PSSession -ComputerName SRV-CORE01 Interactive remote session.

Invoke-Command -ComputerName SRV-CORE01 -ScriptBlock { Get-Service w32time } Run command remotely.

winrm quickconfig Quick-config WinRM service/listener.

Test-WSMan SRV-CORE01 Verify WS-Management connectivity.

Certificates

Command Description
certlm.msc Local machine certificate manager

(GUI).

certutil -store My List LocalMachine\My store.

New-SelfSignedCertificate -DnsName "site.corp.local" -CertStoreLocation Create self-signed cert.

"Cert:\LocalMachine\My"

Export-Certificate -Cert (Get-ChildItem Cert:\LocalMachine\My | ? Subject -like Export public certificate.

"*site.corp.local*") -FilePath C:\site.cer
pvk2pfx -pvk key.pvk -spc cert.cer -pfx cert.pfx Combine to PFX (if tool available).

PowerShell essentials

Command Description

Get-Help Get-Process -Online Open online help for a cmdlet.

Get-Command -Module ActiveDirectory List cmdlets in a module.

Find-Module -Name "*WindowsServer*" Search PowerShell Gallery.

Install-Module -Name SomeModule -Scope AllUsers Install a module.

Get-Service | Where Status -eq Running | Sort Name | Out-GridView Interactive grid (if GUI available).

Start-Transcript -Path C:\Logs\ps-transcript.txt Record session transcript.

Thanks for downloading our free cheat sheet, find more at WindowsMode.com