Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $HomeFolders = Get-ChildItem C:Homefolders -Directory
- foreach ($HomeFolder in $HomeFolders) {
- $Path = $HomeFolder.FullName
- $Acl = (Get-Item $Path).GetAccessControl('Access')
- # $Username = $HomeFolder.Name
- $Ar = New-Object System.Security.AccessControl.FileSystemAccessRule('jacobf', 'Modify', 'ContainerInherit,ObjectInherit', 'None', 'Allow')
- $Acl.SetAccessRule($Ar)
- Set-Acl -path $Path -AclObject $Acl
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement