Command Line Cheat Sheet

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:password@media.thecloudcasting.com

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

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: