Windows 7 / Getting Started

Exporting and Importing File Screens and Quotas

Configuring multiple servers is not easy. You have three options-the first is to configure everything via the command-line utilities, which are the following:

  • dirquota.exe: Used to define, configure, and manage quotas on directories, quota templates, and global options
  • filescrn.exe. Used to define, configure, and manage file screens, file screen exceptions, file screen templates, and global options on directories
  • storrept.exe: Used to define, configure, and manage reports

Manually performing all the configuration via the command-line utilities and then running the commands on all the servers is one option, but it means you need to be an expert in the command line.

The second option is using the same command-line tools to export configuration from one server and then import it into all the other servers. Each tool has good help, but to export a file screen, you just need to give a filename to export to and the name of the template. For example, let's say you have a custom block MP3 template. To export it, use the following:

C:\ >filescrn template export /file:f:\data\fsrm\filescreenmp3.xml
/template:"Block MP3"

Templates exported successfully.

You also created a custom file group, so you need to export it using the same format:

C:\ >filescrn filegroup export /file:f:\data\fsrm\mp3filegroup.xml
/filegroup:"MP3 Files"

File groups exported successfully.

After a template is exported, you can open up the XML and change the settings if required. To import, use the same commands, but with import instead of export. For example:

filescrn template import /file:f:\data\fsrm\filescreenmp3.xml
/template:"Block MP3"

To add a file screen, use the filescrn screen add command with the parameters shown in the help. For example, to apply the custom block MP3 template, use the following:

C:\>filescrn screen add /path:f:\data\media\music\wma
/sourcetemplate:"Block MP3"

File screen successfully created for "f:\data\media\music\wma".

The third option is to script all the actions, discussed in the following section.

Scripting

With Windows Server 2008, a public application programming interface (API) is now available for FSRM as a document on the Microsoft MSDN web site. Although the API can be used in many ways, one easy way is via a VBScript. The following example applies a 100MB quota to the e:\data folder:

Dim quotaManager
Set quotaManager = CreateObject("Fsrm.FsrmQuotaManager")

Dim quota
Set quota = quotaManager.CreateQuota("e:\data")

quota.ApplyTemplate("100 MB Limit")

quota.Commit()

Notice that you create an object of type Fsrm.QuotaManager and then use the object to create a quota instance.

[Previous] [Contents] [Next]