Command Line Cheat Sheet
Some useful command lines:
Find which Logon Server
Echo %logonserver%
Find all Domain Controllers
Nltest /dclist:[Domain Name]
Machine Up Time:
systeminfo | find /i "Boot Time"
Some common run commands: Click Start > Run (or Windows key + R):
Accessibility Options access.cpl
Add New Hardware sysdm.cpl
Add/Remove Programs appwiz.cpl
Date/Time Properties timedate.cpl
Display Properties desk.cpl
FindFast findfast.cpl
Internet Properties inetcpl.cpl
Keyboard Properties main.cpl
Microsoft Exchange mlcfg32.cpl
Network Properties netcpl.cpl
Password Properties password.cpl
Regional Settings intl.cpl
System Properties sysdm.cpl
Device Manager Devmgmt.msc
Disk Management Diskmgmt.msc
AD Users & Computers Dsa.msc
FTP command
ftp://username:[email protected]
Recycle Bin
start shell:RecycleBinFolder
Find Hidden Devices in Device Manager
Set devmgr_show_nonpresent_devices=1
Find Hardware Spec of a PC
msinfo32
Active Directory
Ntdsutil.exe
Group Policy Update – no timeout
gpupdate /force /wait:-1
Boot to safe mode
Msconfig
Run as Admin
Runas /user:domain\Username cmd
Run any Command remotely
Winrs -r:PC1 ipconfig (or any command)
Disable Firewall remotely (this is deprecated in Server 2012)
Winrs -r:PC1 netsh firewall set opmode disable
Disable Firewall remotely Server 2012 +
Winrs -r:PC1 netsh advfirewall firewall set opmode disable
Get MAC address
Getmac -s
Disk Management
Diskpart.exe - disk management utility through CMD
Scan the integrity of all protected system files and replaces incorrect versions with correct Microsoft versions.
SFC [/SCANNOW] [/VERIFYONLY] [/SCANFILE=] [/VERIFYFILE=]
[/OFFWINDIR= /OFFBOOTDIR=
sfc /scannow
Replicate Domain Controllers
Repadmin /replicate
Kam is a Azure and Microsoft Modern Desktop Certified Administrator and Udemy Intructor. He is a solution architect and served clients ranging from educational, private and government establishments in the UK. Kam has worked within the IT industry for the last 7 years building his experience over a variety of products such as DirectAccess, Always On VPN, SCCM, Hyper-V and now focusing on Azure and Modern Desktop/Mobile Device Management.