Homepath profile path set permission
$csv = Import-Csv -Path "$env:userprofile\desktop\KDrivePath.csv"
ForEach ($item In $csv) {
$acl = Get-Acl $item.Path
$AddPerm = New-Object System.Security.AccessControl.FileSystemAccessRule($item.GroupName,"FullControl","ContainerInherit, ObjectInherit", "None","Allow")
$acl.SetAccessRule($AddPerm)
$acl | Set-Acl $item.Path
Write-Host -ForegroundColor Green "Group $($item.GroupName) created!"
}
Comments
Post a Comment