by joe.pesch
28. May 2022 18:30
Powershell Script to set full access to folders in Windows:
$AccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("user_name","FullControl","Allow")
function Get-Folders {
param($path)
$list = ''
$comma = ""
foreach ($folder in Get-ChildItem -Path $path -Recurse -Directory) {
Write-Output $folder.FullName
$ACL = Get-ACL -Path $folder.FullName
$ACL.SetAccessRule($AccessRule)
$ACL | Set-Acl -Path $folder.FullName
Get-Folders $folder.FullName
}
}
Get-Folders 'C:\ProgramData\Docker'
b85d30ac-7d12-4308-a1c6-34ed8e666359|0|.0|96d5b379-7e1d-4dac-a6ba-1e50db561b04
Tags:
Windows