Setting permissions for 1800 top level folders

Copper Contributor

Hello, we have a network share with over 1800 top level folders. The permissions at the share level were modified by accident and that change was inherited into every top level folder and child object. I've tried to reassign the correct permissions at the share level and have the permissions inherited to the child objects but it it always gets interrupted (someone reboots the machine or logs in) and when I reapply the permissions it starts the process all over again, applying the permissions to folders that have already been corrected. 

 

Example of the folder layout:

X:\Share\

X:\Share\folder1

X:\Share\folder2

etc..... 

 

How can I script this with powershell to do the following:

 

- Apply permissions for 9 different groups to each top level folder and have those permissions inherited by the child objects

- each of the 9 groups have different permissions. some read/write, some List, some full control. the groups would need to keep their respective permissions applied to each folder

- apply these permissions to all child objects

 

I have a list of all the folders that need the permissions applied. Ideally my script would loop though the list applying the correct permissions to each folder in it. Should it get interrupted I would be able to easily restart by removing completed folders from my list. 

 

I'd like to create an array of the permissions and then run a set-acl command to apply all the permissions listed in the arr

1 Reply
continued........

I'd like to create an array of the permissions and then run a set-acl command to apply all the permissions listed in the array. 

Any advice on how to accomplish this is appreciated. 



thank you.