WINDOWS SYSADMIN COMMANDS ( EXPLORER / CMD / POWERSHELL )

please use these tools with caution, data loss can happen.
use help ( /?, /help, -?, -help, get-command) if necessary.

 

 

---

 

 

USEFUL COMMANDS ( POWERSHELL ):
( | out-gridview is optional )

 

command description
get-command * list all powershell commands / aliases / help
get-process shows all processes
stop-process -name [appname] stop application / process by name
stop-process -id [appid] stop application / process by id
calc start calculator
cd c:\users\[username]\desktop change current directory to users desktop
dir -name list current directory files and forlders
chkdsk c: checks disk drive c for errors !use with caution - read help before start!
get-service shows all services
powershell_ise start ps_ise utility - use it to learn powershell
taskmgr start task-manager gui
whoami shows hostname and current username
winver shows build details about windows
get-childitem -path *.txt -recurse list all txt-files (textfiles) from current directory and all subfolders
firewall open windows firewall gui
get-date shows date and time
get-disk shows available disks
get-netadapter shows available net interfaces
get-netipinterface shows connections
get-ciminstance win32_computersystem show information about host system
get-volume list all disk volumes
systeminfo host system information / check hyper-v requirements

 

 

---

 

 

DESKTOP / WORKSTATION / ( SERVER ) ( GUI SETTINGS ):
( use windows search / run / powershell to input and start .msc applications )

 

msc file console description
compmgmt.msc computer management includes system tools ( task scheduler, event viewer, shared folders, local users and groups, performance and device manager ), storage ( disk management ), and services and applications ( services and wmi control )
devmgmt.msc device manager opens the device manager to manage hardware and devices
devmoderunasuserconfig.msc
diskmgmt.msc disk management opens disk management to administrate connected storage devices
eventvwr.msc event viewer opens the event viewer which displays operating system, software, and hardware events
fsmgmt.msc shared folders loads the list of shared folders, sessions, and open files
gpedit.msc group policy editor loads the group policy editor to manage system policies
lusrmgr.msc local users and groups interface to manage local users and user groups
perfmon.msc performance monitor loads the windows performance monitor
printmanagement.msc print management manage printers
secpol.msc local security policy loads policies such as account policies, public key policies, or advanced audit policy configuration
services.msc services manager loads the list of installed services to manage them
taskschd.msc task scheduler loads the task scheduler to manage tasks
wf.msc windows firewall starts windows firewall with advanced security
wmimgmt.msc wmi management configure and control the windows management instrumentation service

 

 

---

 

 

SERVER ( GUI SETTINGS ):

 

msc file console
adsiedit.msc adsi edit
dnsmgmt.msc dns manager
domain.msc active directory domains and trust
dsa.msc active directory users and computers
dssite.msc active directory sites and services
gpmc.msc group policy management
gpme.msc group policy mangement editor
servermanager server manager
wbadmin.msc windows server backup

 

 

---

 

 

NETWORK COMMANDS ( CMD / POWERSHELL ):

 

type description
ping test network host communication
netstat test network communication
arp map ip adresses to mac addresses
nbtstat diagnose domain
hostname display hostname
tracert test network hosts communication
ipconfig /all display host and network information
nslookup diagnose dns
route view routing tables
pathping test and ping hosts

 

 

---

 

 

OTHER COMMANDS ( CMD / POWERSHELL ):

 

type description
diskpart manage hard-drives
pnputil manage drivers
icacls manage permissions
bcdedit boot configuration data editor
slmgr -rearm renew windows lisence
driverquery view installed drivers
gpupdate /force update policies
control open control panel

 

 

---

 

 

DISKPART COMMANDS ( CMD / POWERSHELL ):

 

type description
select disk 0 select primary disk
list disk shows disks
list partition shows partitions of active disk
list volume shows details about disks
detail disk shows details about selected disk

 

 

 

---

 

 

KEYBOARD SHORTCUTS ( WIN = WINDOWS KEY ):

 

press action
WIN + D show / hide desktop
WIN + E show file explorer
WIN + I show settings
WIN + R show run
WIN + S show search
WIN + T switch applications
WIN + X show command menu
WIN + Pause show system
WIN + TAB show / switch open applications
WIN + Arrows change app layout
CTRL + SHIFT + ESC task manager
ALT + F4 close window

 

 

 

---

 

 

HIDE FILES / FOLDERS (POWERSHELL):

attrib +s +h *.* /D

UNHIDE FILES / FOLDERS (POWERSHELL):

attrib -s -h *.* /D

 

---

 

 

[WIN] + r and type:

 

shell:startup
(Open folder with shortcuts to open applications on windows boot)

shell:appsfolder
(Open folder containing all application menu items)

 

---

 

 

 

SUBNETTING (example in yellow):

 

number of subnets:
1 2 4 8 16 32 64 128 256
number of hosts per subnet: 256 128 64 32
16 8 4 2 1
subnet mask: /24 /25 /26 /27 /28 /29 /30 /31 /32

 

 

example of original network ID: 192.168.4.0 /24 ,with 4 subnets:
network ID: subnet mask: host ID range: number of usable hosts: broadcast ID:
192.168.4.0 /26 192.168.4.1 - 192.168.4.62 62 192.168.4.63
192.168.4.64 /26 192.168.4.65 - 192.168.4.126 62 192.168.4.127
192.168.4.128 /26 192.168.4.129 - 192.168.4.190 62 192.168.4.191
192.168.4.192 /26 192.168.4.193 - 192.168.4.254 62 192.168.4.255
subnet mask: 255.255.255.192
wildcard mask: 0.0.0.63
binary subnet mask: 11111111.11111111.11111111.11000000
IP / network class type: C
CIDR notation: /26

 

Subnet masks:
CIDR subnet mask: subnet mask: binary subnet mask:
/24 255.255.255.0 11111111.11111111.11111111.00000000
/25 255.255.255.128 11111111.11111111.11111111.10000000
/26 255.255.255.192 11111111.11111111.11111111.11000000
/27 255.255.255.224 11111111.11111111.11111111.11100000
/28 255.255.255.240 11111111.11111111.11111111.11110000
/29 255.255.255.248 11111111.11111111.11111111.11111000
/30 255.255.255.252 11111111.11111111.11111111.11111100
/31 255.255.255.254 11111111.11111111.11111111.11111110
/32 255.255.255.255 11111111.11111111.11111111.11111111

 

 

Link (PDF): Networking Sertification Cheatsheet

 

 

 


 Osi-Model short explanation

 

 

 

 

SysAdmin PowerShell script #01:

 

system-info.ps1

# This script displays information of host and checks network connection
# Author: http://henkka.info/domainmap

# display host name:
Write-Host "-> 1/9 : Host name:"
whoami.exe

# Display system information:
Write-Host "-> 2 / 9 : System information 1:"
systeminfo.exe

# Display system information:
Write-Host "-> 3 / 9 : System information 2:"
get-ciminstance win32_computersystem

# Display drive information:
Write-Host "-> 4 / 9 Drive information 1:"
Get-Volume

# Display drive information:
Write-Host "-> 5 / 9 : Drive information 2:"
Get-Disk

# Display host netwok adapter summary:
Write-Host "-> 6 / 9 : Network adapter information:"
Get-NetAdapter

# Test local host network connectivity:
Write-Host "-> 7 / 9 : Test local host:"
ping 127.0.0.1

# Display host network information:
Write-Host "-> 8 / 9 : Host network information:"
ipconfig.exe /all

# Check network connection from host to Google server:
Write-Host "-> 9 / 9 : Test route to Google.fi:"
tracert.exe google.fi

 

 

SysAdmin PowerShell script #02:

 

open-settings.ps1

# This script opens few settings GUI windows on windows host
# Author: http://henkka.info/domainmap

# Open control panel:
control.exe

# Open task manager:
Taskmgr.exe

# Display windows version:
winver.exe

# Open device manager:
devmgmt.msc

# Open disk manager:
diskmgmt.msc

# Open services gui:
services.msc

 

Use this command in Powershell if you can not run scripts:

Set-ExecutionPolicy Unrestricted

 

 

page by: it.henkka.info

-> Linux cheat sheet

Updated: 21-03-23 (d/m/y)