cawasaki
asked on
Powershell script to create folder from csv and applicate ntfs permission
hello,
i need to create a new folder and permission from a csv file.
the csv file contain the name of folder and a group or user to applicate permisison on it.
all folder will be created on a shared folder that i can access with this link: \\shared\test
the csv file is in this form:
for exemple for folder1 create it and applicate full control right for active directory group named group1 and group 2 and user user1....
for folder 1 applicate ntfs permisison with modify right for group4 and group 5...
i hope i am clear and thanks for help
i need to create a new folder and permission from a csv file.
the csv file contain the name of folder and a group or user to applicate permisison on it.
all folder will be created on a shared folder that i can access with this link: \\shared\test
the csv file is in this form:
folder,full_control,modify,read_execute,List_folder_content,read,write
folder1,group1;group2;user1,group4;group5,group6,group7;group8,group9,group10
folder2,group1;group2;user1,group4;group5,group6,group7;group8,group9,group10
.......
where folder1 and folder2 is a folder to create on \\shared\testfor exemple for folder1 create it and applicate full control right for active directory group named group1 and group 2 and user user1....
for folder 1 applicate ntfs permisison with modify right for group4 and group 5...
i hope i am clear and thanks for help
(i made an edit, please be sure to refresh the page)
ASKER
hello
i will test now
hello,
are with this script when i will copie sub folder and files, it will inherit permisison from parent folder?
thank you
i will test now
hello,
are with this script when i will copie sub folder and files, it will inherit permisison from parent folder?
thank you
ASKER
the script work and this is my question:
1-are with this script when i will copie sub folder and files, it will inherit permisison from parent folder?
2-it is possible to change one think: i prefer the script get the path from csv file, because i have many folder and subfolder to create:
folder,full_control,modify ,read_exec ute,List_f older_cont ent,read,w rite
\\localhost\Share\folder1, group1;gro up2....... .......... ..........
\\localhost\Share\folder1\ test,group 1;group2.. .......... .......... .....
\\localhost\Share\folder2, group1;gro up2....... .......... ..........
\\localhost\Share\folder2\ test,group 1;group2.. .......... .......... .....
only last folder will be created and permisison applicated on it.
i will create a csv file by folder level.
thanks for help
1-are with this script when i will copie sub folder and files, it will inherit permisison from parent folder?
2-it is possible to change one think: i prefer the script get the path from csv file, because i have many folder and subfolder to create:
folder,full_control,modify
\\localhost\Share\folder1,
\\localhost\Share\folder1\
\\localhost\Share\folder2,
\\localhost\Share\folder2\
only last folder will be created and permisison applicated on it.
i will create a csv file by folder level.
thanks for help
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry i am out of office bow i will accept the solution and if i have a problem i will open a new question
Thanks
Thanks
ASKER
hello,
i have open new question here:
https://www.experts-exchange.com/questions/28965308/modify-powershell-script-to-not-inherit-ntfs-permission-from-parent.html
i need now that the new folder created from the script do not inherit from parent folder permisison
thanks for help
i have open new question here:
https://www.experts-exchange.com/questions/28965308/modify-powershell-script-to-not-inherit-ntfs-permission-from-parent.html
i need now that the new folder created from the script do not inherit from parent folder permisison
thanks for help
Edit $path to the root path of your share, and $csvFile to the path of your create CSV.
Open in new window
This code can be easily edited by adding more columns to your CSV. Just add a line like this:
Open in new window
And change COLUMNNAME to the new CSV column and PERMISSIONLEVEL to one of these.