10 lines
368 B
PowerShell
10 lines
368 B
PowerShell
$computerName = $env:COMPUTERNAME
|
|
$domain = (Get-WmiObject Win32_ComputerSystem).Domain
|
|
|
|
$folderPath = "C:\Scripts"
|
|
$groupName = "Authenticated Users"
|
|
|
|
$acl = Get-Acl -Path $folderPath
|
|
$acl.SetAccessRuleProtection($true, $false)
|
|
$acl.RemoveAccessRule($acl.Access | Where-Object {$_.IdentityReference -eq "$domain\$groupName"})
|
|
Set-Acl -Path $folderPath -AclObject $acl |