Can this be done the way I specify below? If so, can someone post an example of a script that would work?
2 directory structures need to be modified
\\server\documents\%username%
\\server\userprofiles\%username%
Take ownership of folders saved below \\server\documents\ and below \\server\userprofiles\ and all the files and subfolders contained inside
Grant administrators full control to all these folders and the files and subfolders inside
Add these permissions to those folders and contents
Foldername(the name of the folder is %username% set to Full Control
local sytstem set to full control
administrators set to full control
change owner of folder and its contents to foldername
It must be able to handle errors such as not being able to find a valid username that matches the name of ther folder (typo in hand created folder or if the folder name is based on a user account that no longer exists etc.). In that case write a log listing
folders where it could not set permissions.
If some files inside folders are locked/in use by user and that prevents changing permissions, skip those files and continue. List is separate log file so we can contact the user and rerun script while they are logged out.
Most users in this domain stay logged in constantly other than to reboot even when they are not using the PC so they don't have to reopen all their documents and applications every morning when they start. Can permissions be modified while the files are
in use by the user (assuming the permssion change is not one that removes their permission to read and modify those open files)?