The Storage Team Blog about file services and storage features in Windows and Windows Server.
For an overview of File Classification Infrastructure, check Classifying files based on location and content using the File Classification Infrastructure (FCI) in Windows Server 2008 R2.
Previously we showed you how to expire stale data using File Management Tasks in Windows Server 2008 R2. Now let’s look at what else can be done with them.
As stated previously, File Management Tasks are a mechanism to apply a simple command 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 right here
The other option in the drop down is “Custom.” 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 writable 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 and that would be bad.
Here we’ve configured the command to be cmd.exe. The parameters indicate a script file should be launched and a parameter should be passed to that. When editing the parameters, you can use the dropdown list of macros to add them to the parameter list. They will be replaced with the correct values when the action is run. In this case we only use the file path of the file that matches the criteria.
The script being run here is the following one:
@call :MOVE_FILE %1 @goto :EOF
:MOVE_FILEif EXIST "C:\Secondary\%~pnx1" @echo Target file already exists! & goto :EOFmd "C:\Secondary\%~p1"move %1 "C:\Secondary\%~p1"mklink %1 "C:\Secondary\%~pnx1"@goto :EOF
This script basically
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 with this? We could use it to
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.
Post by Matthias Wollnik
During the initial planning phases of R2, we had the opportunity to interview several IT professionals
I wanted to call your attention to four new blog posts this morning from Nir Ben Zvi (Senior Program
(This is a follow up to the blog entry that presented the File Classification Infrastructure in Windows
Really good explanation folks, would like a little more explanation on how the wildcard option works as i seem to be getting some variying reponses.