Get-WmiObject -Class Win32_Bios | Select-Object SerialNumberRename-Computer -NewName "<HOSTNAME>" -Restart-
Enable local administrator account:
net user Administrator "<PASSWORD>" net user Administrator /active:yes
-
Disable local administrator account:
net user Administrator /active:no
-
Delete a user:
net user "<USERNAME>" /delete
-
Add a user to
Administratorsgroup:net localgroup Administrators "<USERNAME>" /add
-
Remove a user from
Administratorsgroup:net localgroup Administrators "<USERNAME>" /delete
-
Get IP configuration:
ipconfig /all -
Get MAC addresses:
# PowerShell Get-NetAdapter | Select-Object Name, InterfaceDescription, MacAddress # Command Prompt getmac /v
-
Test network connectivity:
# PowerShell Test-NetConnection -ComputerName "<TARGET>" -Port "<PORT>" # Command Prompt ping "<TARGET>" telnet "<TARGET>" "<PORT>"
-
Refresh network configuration
# PowerShell Remove-NetIPAddress -InterfaceAlias "<INTERFACE>" -Confirm:$false Set-NetIPInterface -InterfaceAlias "<INTERFACE>" -Dhcp Enabled Clear-DnsClientCache # Command Prompt ipconfig /release ipconfig /renew ipconfig /flushdns
-
Get routing table:
route print
-
System File Checker (SFC):
sfc /scannow -
Deployment Image Servicing and Management (DISM):
DISM /Online /Cleanup-Image /CheckHealth DISM /Online /Cleanup-Image /ScanHealth DISM /Online /Cleanup-Image /RestoreHealth
-
Check disk for filesystem errors:
chkdsk /f
# Set all local users' passwords to never expire
Get-LocalUser | ForEach-Object { $_ | Set-LocalUser -PasswordNeverExpires $true }
# Set system-wide password policy to never expire
net accounts /maxpwage:unlimited| Shortcut | Description |
|---|---|
msinfo32 |
System Information |
ncpa.cpl |
Network Connections |
sysdm.cpl |
System Properties |
devmgmt.msc |
Device Manager |
diskmgmt.msc |
Disk Management |
regedit |
Registry Editor |
gpedit.msc |
Local Group Policy Editor |
services.msc |
Services |
wf.msc |
Windows Defender Firewall with Advanced Security |
cmd |
Command Prompt |
powershell |
PowerShell |
Tip
To run any command as administrator, press Ctrl + Alt + Enter