Essential PowerShell Commands Every Windows & Network Administrator Must Know
Suresh Thapa
Mastering PowerShell is a game-changer for system and network administrators. From managing users, services, and processes to monitoring networks, Active Directory, and automating tasks, these essential PowerShell commands will save you time, boost efficiency, and make troubleshooting easier. This guide covers the most important commands every Windows and network admin should have in their toolkit.
Here’s a practical list of PowerShell commands that every Network and Windows Admin should know. I’ll group them by category so you can use them as a reference/cheat sheet:
System Info & Basics
| Command | Description |
|---|---|
Get-ComputerInfo | Show detailed system information (OS, BIOS, hardware). |
Get-Command | List all available PowerShell commands. |
Get-Help <cmd> | Get help/documentation for a command. |
Get-ExecutionPolicy | Check script execution policy. |
Set-ExecutionPolicy RemoteSigned | Allow running local scripts. |
User & Group Management
| Command | Description |
|---|---|
Get-LocalUser | List local users. |
Get-LocalGroup | List local groups. |
Get-LocalGroupMember "Administrators" | Show group members. |
New-LocalUser "TestUser" -Password (Read-Host -AsSecureString) | Create new user. |
Add-LocalGroupMember -Group "Administrators" -Member "TestUser" | Add user to group. |
Remove-LocalUser "TestUser" | Delete local user. |
Process & Service Management
| Command | Description |
|---|---|
Get-Process | List running processes. |
Stop-Process -Name notepad | Kill a process. |
Get-Service | List all services. |
Start-Service Spooler | Start Print Spooler service. |
Stop-Service Spooler | Stop Print Spooler service. |
Restart-Service Spooler | Restart a service. |
Networking
| Command | Description |
|---|---|
Get-NetIPAddress | Show IP addresses. |
Get-NetIPConfiguration | Show IP, DNS, Gateway. |
Test-Connection google.com | Test connectivity (like ping). |
Test-NetConnection google.com -Port 443 | Test specific port. |
Get-NetAdapter | Show network adapters. |
Get-NetTCPConnection | Show active TCP connections. |
Active Directory (AD)
| Command | Description |
|---|---|
Import-Module ActiveDirectory | Import AD module. |
Get-ADUser -Filter * | Select Name,Enabled | List AD users. |
Get-ADGroup -Filter * | List AD groups. |
Get-ADComputer -Filter * | List AD computers. |
New-ADUser -Name "John Doe" -Enabled $true | Create new AD user. |
Add-ADGroupMember -Identity "Domain Admins" -Members jdoe | Add user to group. |
File & Folder Management
| Command | Description |
|---|---|
Get-ChildItem C:\ | List files/folders (like dir/ls). |
Copy-Item C:\file.txt D:\ | Copy file. |
Move-Item C:\file.txt D:\ | Move file. |
Remove-Item C:\file.txt | Delete file. |
Get-Content C:\log.txt | Read file content. |
Set-Content C:\file.txt "Hello World" | Write to file. |
Event Logs & Monitoring
| Command | Description |
|---|---|
Get-EventLog -LogName System -Newest 20 | Show latest system logs. |
Get-WinEvent -LogName Security | Where {$_.Id -eq 4625} | Show failed logins. |
Remote Management
| Command | Description |
|---|---|
Enter-PSSession -ComputerName Server01 | Connect to remote machine. |
Invoke-Command -ComputerName Server01 -ScriptBlock {Get-Service} | Run command remotely. |
Get-WmiObject Win32_OperatingSystem -ComputerName Server01 | Get OS info remotely. |
Security & Firewall
| Command | Description |
|---|---|
Get-NetFirewallProfile | Show firewall profiles. |
Get-NetFirewallRule | List firewall rules. |
New-NetFirewallRule -DisplayName "Allow ICMP" -Protocol ICMPv4 -Action Allow | Allow ping in firewall. |
Updates & Patching
| Command | Description |
|---|---|
Get-WindowsUpdateLog | View update log. |
Install-WindowsUpdate -AcceptAll -AutoReboot | Install updates (requires PSWindowsUpdate module). |
Pro Tip:
- Use
Get-Help <command> -Examplesto see real usage examples. - Use
Get-Command *keyword*to discover related commands. - For automation, combine with pipelines
|and filtering (Where-Object,Select-Object).
Tags:
Powershell
Windows