Created
June 7, 2018 10:29
-
-
Save phillip-haydon/46435fddc9d41e6e8bf614e44aa3495e to your computer and use it in GitHub Desktop.
Powershell - Disable Shutdown / Restart buttons on Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install-Module -Name PolicyFileEditor -SkipPublisherCheck -Force | |
$UserDir = "$env:windir\system32\GroupPolicy\User\registry.pol" | |
# After manually setting the values in Local Group Policy Editor (gpedit.msc), extract the values our so we can set them | |
# Get-PolicyFileEntry -Path $UserDir -All | |
# Disable the Shutdown / Restart options | |
# http://brandonpadgett.com/powershell/Local-gpo-powershell/ | |
# http://blog.willbeattie.com/2010/01/disabling-shut-down-button-on-windows.html | |
$RegPath = 'Software\Microsoft\Windows\CurrentVersion\Policies\Explorer' | |
$RegName = 'NoClose' | |
$RegData = '1' | |
$RegType = 'DWord' | |
Set-PolicyFileEntry -Path $UserDir -Key $RegPath -ValueName $RegName -Data $RegData -Type $RegType |
Oh yeah sorry, did not read all the way, silly me, I did want to promote ;D
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah I saw this message back then, he just want to promote his script :D