As stated previously, File Management Tasks are a mechanism to apply a commands to a selected set of files on a scheduled basis. The trick to applying an action other than Expiration to the selected files is simply to change a drop down box on the Task’s Action tab. You can see the default action here:
The other two options in the drop down are "Custom" and "RMS Encryption". With a Custom File Management Task, you can then specify an arbitrary executable with a series of parameters that will be run for each file that matches the conditions of the File Management Task. The only restriction is that the executable as well as the folder structure the command is contained in (as in all parent folders) must be writeable for Administrator and System only. If we did not impose this restriction a non-authenticated user would be able to replace the command being run.
We will now provide an example of using a Custom File Management Task to do something useful. The script we will give essentially:
looks at the folder structure of the file passed in as the first parameter
creates a new directory under the folder passed in as the second parameter with the folder structure path discovered in step 1
moves the file into that new directory
creates a link to the file in its original location
Copy and paste this script into C:\Windows\System32\MoveCreateLink.ps1:
Effectively we built a simple form of Hierarchical Storage management with a few lines of batch scripting. Since this script does alter files, we need to set the custom action to run as Local System. However, if your executable needs lower permissions, you can restrict the account it runs in further.
Now what else can we do this? We could use Custom File Management Tasks to:
Compact database files that haven't been modified in a year (custom action of compact.exe with a condition of not modified for 365 days and a file name of *.mdb)
Remove the Everyone ACL from all files older than 3 days
Generate a report of all files containing the word "confidential" that have not been modified in a year (custom script with no parameters, a condition that references a classification property with an appropriate classification rule that searches for the word "Confidential", and setting the File Management Task report to be generated in the appropriate formats)
Remember that these File Management Tasks are scheduled and can happen as often or as rarely as you would like. Tell us you think you could leverage custom File Management Tasks.