用管理員身分啟動 Windows PowerShell
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerManagement"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerManagement" -Name "ACSettingIndex" -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerManagement" -Name "DCSettingIndex" -Value 0
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerManagement\ExceptionUsers"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerManagement\ExceptionUsers" -Name "<Username>" -Value 0
您需要將「<Username>
」替換為要排除的使用者的帳戶名稱