Created
August 8, 2020 17:49
-
-
Save nrchandan/4cc371b8756ec38809c3fb2ca32a33cf to your computer and use it in GitHub Desktop.
This file contains 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
$acl = Get-Acl C:\ProgramData\ssh\administrators_authorized_keys | |
$acl.SetAccessRuleProtection($true, $false) | |
$administratorsRule = New-Object system.security.accesscontrol.filesystemaccessrule("Administrators","FullControl","Allow") | |
$systemRule = New-Object system.security.accesscontrol.filesystemaccessrule("SYSTEM","FullControl","Allow") | |
$acl.SetAccessRule($administratorsRule) | |
$acl.SetAccessRule($systemRule) | |
$acl | Set-Acl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment