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

altiris software key

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

Troubleshooting Netlogon Error Codes