Windows VPS & RDP

PowerShell essentials for Windows Server administrators

The PowerShell commands every Windows Server VPS owner should know: services, processes, files, networking, users, updates and events, with safe examples.

BeginnerWindows Server VPS2 min read

PowerShell lets you manage a Windows Server faster than clicking through menus, and the same commands work in scripts and scheduled tasks. This guide covers the commands you will use most on a VPS, grouped by task.

Before you start

  • An RDP session as an administrator (see connect with RDP).
  • Open PowerShell as administrator: right-click Start → Windows PowerShell (Admin) or Terminal (Admin).

Find commands and help

Get-Command *service*
Get-Help Get-Service -Examples
Get-Service | Get-Member

Commands follow a Verb-Noun pattern (Get-, Set-, Start-, Stop-). Press Tab to complete names.

Services

Get-Service | Where-Object Status -eq 'Running'
Restart-Service W3SVC
Set-Service -Name W3SVC -StartupType Automatic

Processes

Get-Process | Sort-Object CPU -Descending | Select-Object -First 10
Get-Process | Sort-Object WorkingSet -Descending | Select-Object -First 10 Name, @{n="MB";e={[int]($_.WorkingSet/1MB)}}
Stop-Process -Name notepad

Files and folders

Get-ChildItem C:\inetpub -Recurse -Filter *.config
Copy-Item C:\site C:\backup\site -Recurse
Compress-Archive -Path C:\site -DestinationPath C:\backup\site.zip
Get-Content C:\logs\app.log -Tail 50 -Wait

Disk space

Get-Volume
Get-PSDrive -PSProvider FileSystem

Network

Get-NetIPAddress -AddressFamily IPv4
Test-NetConnection example.com -Port 443
Get-NetTCPConnection -State Listen | Sort-Object LocalPort

Firewall rules have their own guide: RDP firewall rule.

Local users

Get-LocalUser
New-LocalUser -Name "alex" -Password (Read-Host -AsSecureString)
Add-LocalGroupMember -Group "Remote Desktop Users" -Member "alex"

See create a Windows user with RDP access.

System info, events and restarts

Get-ComputerInfo | Select-Object WindowsProductName, OsVersion, CsTotalPhysicalMemory
Get-HotFix | Sort-Object InstalledOn -Descending | Select-Object -First 5
Get-WinEvent -LogName System -MaxEvents 20
Restart-Computer

Execution policy for scripts

To run your own .ps1 scripts, RemoteSigned is a sensible default:

Set-ExecutionPolicy RemoteSigned -Scope LocalMachine

Warning: Never paste scripts from untrusted sites into an admin PowerShell window. Read what a script does first. For a locked-down approach see PowerShell execution policies.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.