Scripts to configure secure permissions on shares for folder redirection and home drives etc.
For home drives, redirected folders, user profiles etc. it’s important to ensure folder permissions are set correctly. These permissions can be scripted for easy creation of these shares.
Based on recommendations set out in these articles:
- How to dynamically create security-enhanced redirected folders by using folder redirection in Windows 2000 and in Windows Server 2003
- Deploy Folder Redirection with Offline Files
Batch file that demonstrates using ICACLS and NET SHARE commands to create a folder with secure permissions and share it.
PowerShell approach to creating a folder with secure permissions and sharing the folder. Currently this script works locally, with remote support intended for a future release.
Create a secure share for the folder E:\Home named Home, with Offline Settings set to automatic.
.\New-SecureShare.ps1 -Path "E:\Home" -CachingMode Documents
Create a secure share for the folder E:\Profiles named Profiles, with Offline Settings set to none and sets a custom description.
.\New-SecureShare.ps1 -Path "E:\Profiles" -Description "User roaming profiles"