管理 Windows VPS 的服务。
📋 前提条件
- Administrator RDP or PowerShell session
- Service name (e.g.
W3SVC,sshd)
List services
PowerShellGet-Service | Sort-Object Status, Name | Format-Table -AutoSize
Control a service
PowerShellStop-Service -Name W3SVC -Force Start-Service -Name W3SVC Restart-Service -Name W3SVC
Set automatic startup
PowerShellSet-Service -Name sshd -StartupType Automatic Get-Service sshd
Check recent system errors
PowerShellGet-EventLog -LogName System -Newest 20 | Where-Object { $_.EntryType -eq 'Error' }
管理到位!🚀