cls # Модуль AD Import-Module ActiveDirectory # где $Dir = "C:\test" # кто $Users = Get-ADUser -Filter * -SearchBase "OU=Пользователи,DC=domen,DC=my,DC=ru" # папки и права foreach ($User in $Users) { $User = $User.sAMAccountName $Path = New-Item -ItemType Directory -Path $Dir -Name $User $Args = New-Object system.security.accesscontrol.filesystemaccessrule($User,"Read, Synchronize", "ContainerInherit, ObjectInherit", "None", "Allow") $ACL = Get-Acl $Path $ACL.SetAccessRule($Args) Set-Acl $Path $ACL } |