Avatar of Roccat
Roccat
Flag for United States of America asked on

Change permissions

I am creating AD home folders.  Our users get permsissions to "modify, read & execute, list folder contents, read, write"   Can you help me modify my script so that it gets these same permssions. When I apply the script the user gets full control and it appears as special permissions.  When I change fullcontrol to modify it still comes up as special permissions.  When I apply the modify option in the script and I  explore special permissions the user does not have permission to delete files or sub folders.  What should I do to apply the permissions that users get when I create the account and homefolder using the ADUC from RSAT tools.

New-Item -type directory -path "\\127.0.0.1\Share\$($ADUser['SamAccountName'])"
$Acl = Get-Acl "\\127.0.0.1\Share\$($ADUser['SamAccountName'])"
$Ar = New-Object system.security.accesscontrol.filesystemaccessrule("$($FirstName[0])$($LastName)","FullControl","Allow")
$Acl.SetAccessRule($Ar)
Set-Acl "\\127.0.0.1\Share\$($ADUser['SamAccountName'])" $Acl

Open in new window

Powershell

Avatar of undefined
Last Comment
Roccat

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Roccat

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy