Set Static IP Via cmd
I’ve found this command useful for testing purposes.
netsh interface ipv4 set address name=[interfacename] static [myip] [subnetmask] [gateway]
netsh interface ipv4 set address name=[interfacename] dhcp
- netsh interface ipv4 set address name=”local area connection” static 172.16.2.8 255.255.0.0 172.16.2.254
- netsh interface ipv4 set address name=”wireless network connection” dhcp
- netsh interface ipv4 set dnsservers name=”wireless network connection” static 10.0.0.1 primary
- netsh interface ipv4 set dnsservers name=”wireless network connection” dhcp
Check Who’s Logged in on Server
This allows you to check if anyone’s rdp-ed into a server before logging into it to avoid booting someone off (open cmd as administrator).
Check OU a Computer is stored under in Active Directory
Outputs the OU a computer is stored under.
dsquery computer -name [computername]
Copy output of command to clipboard
Pipe a command into “clip”
- ipconfig /all | clip
- echo “Purple Monkey Dish Washer” | clip
Open notepad to scribble a note very fast
Not really a command, but very useful anyhow when you need to jot down a detail or copy something from the clipboard somewhere temporarily.
Hit “Windows Key + R”, type “notepad” and hit enter. Starts nearly instantly and lets you type a note, phone number etc.
Append text to file
To add content to the end of a file, or create and add content to a file if it doesn’t exist, put “>> [filename]” after a command to copy the output to a file.
echo %computername% >> c:\myfile.txt
ipconfig /all >> c:\myfile.txt
ipconfig /displaydns>> c:\myfile.txt
Get the MAC address of a remote computer
Returns the MAC address of a computer
getmac /s [computername]