2
0

Removed User Permissions to Scripts Folder

This commit is contained in:
bschaper 2025-01-14 11:59:36 -06:00
parent 5f133e5cb1
commit 077bd02831
2 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,10 @@
$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

View File

@ -91,6 +91,10 @@ powershell Remove-Item -Path 'C:\Scripts\Software\Office2016' -Recurse -Force
powershell Remove-Item -Path 'C:\Scripts\Software\RemoteAgent64-TCSE.exe'
powershell Remove-Item -Path 'C:\Scripts\Software\gcpwstandaloneenterprise64.exe'
:: Remove Permissions
echo Removing User Permissions to Scripts Folder...
powershell -ExecutionPolicy Bypass -File "C:\Scripts\Patches\Windows\Remove-Permissions.ps1"
:: Perform Windows Updates
powershell -ExecutionPolicy Bypass -File "C:\Scripts\Patches\Windows\Initial-Windows-Updates.ps1"