victor2008
asked on
PowerShell Script to change folder permissions?
Does anyone know how to tweak this script so that after it creates each new user folder, it removes the permissions each folder inherited, and only adds the ones you have specified.
https://gallery.technet.microsoft.com/scriptcenter/How-to-create-home-folder-d968f1d4
https://gallery.technet.microsoft.com/scriptcenter/How-to-create-home-folder-d968f1d4
ASKER
Thank you. The folder where the user folders are created has some permissions that get propagated down to the new folders. I want to remove those groups, then add new groups. The adding new groups works, but don't know how to remove what's there first. I can remove inheritance with $HomeFolderACL.SetAccessRu leProtecti on($true,$ true) but want to remove some groups that get inherited.
First off this script is creating the directory for HomeFolder location
Just to be 100% clear you are looking to reassign ACL to the home folder structure, not create folders?
Just to be 100% clear you are looking to reassign ACL to the home folder structure, not create folders?
ASKER
The script creates a home folder for each user in the list (which it does). I want the script to create each folder like it does and give the user full control like it does, but first remove the permissions for each user folder that gets inherited from it's parent.
This script does create a folder with no inherited security and then sets the security based on the script . I am not sure what you want to tweak.
By design that is exactly how this script works.
By design that is exactly how this script works.
ASKER
In my experience, when it creates the new user folder, the parent security group is inherited to the new user folder.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It creates a default of "NT AUTHORITY\SYSTEM","BUILTIN
I am not sure what you want to remove.