Hello All,
Below script worked fine. Now i have added two more line to add the permission to folder. after folder created permission will be assigned only last line of permission I.E domain\userread123. First 02 permission lines not assigning permission,
Thanks in advance
Set-Location "C:\Users\narasimha.s\Desktop\foldertest"
$Folders = Import-Csv C:\Users\Narasimha.s\Desktop\foldertest\project.csv
ForEach ($Folder in $Folders) {
$newFolder = New-Item -name $Folder.Name -type directory
$acl = Get-Acl $newFolder.FullName
$ace = New-Object System.Security.AccessControl.FileSystemAccessRule('domain\usermodify', 'Modify,Synchronize', 'ContainerInherit,ObjectInherit', 'None', 'Allow')
$ace = New-Object System.Security.AccessControl.FileSystemAccessRule('domain\userread', 'Read,Synchronize', 'ContainerInherit,ObjectInherit', 'None', 'Allow')
$ace = New-Object System.Security.AccessControl.FileSystemAccessRule('domain\userread123', 'Read,Synchronize', 'ContainerInherit,ObjectInherit', 'None', 'Allow')
$acl.AddAccessRule($ace)
Set-Acl $newFolder.FullName -AclObject $acl
}
Select all Open in new window
Instated if Read I have mentioned Full getting error
What would be the syntax for Full Permission