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

Popular posts from this blog

Service Principal Names (SPNs) SetSPN Syntax (Setspn.exe)

altiris software key

Group Policy: Troubleshooting Overview