2
0
tcse-deploy/Patches/Windows/Remove-Permissions.ps1
2025-01-14 11:59:36 -06:00

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