Jump to content

FSRM: Quota Management - 'Command' with variables


Recommended Posts

Hi,

I have some issue with the quota management configuration (W2003 R2 - FSRM)

I want to launch a script when a threshold has been reached for a folder: selecting the 'Command' tab and configuring the 'Command arguments' with "fixed" strings works fine: the script is executed and passes arguments correctly.

What about variables ?

-A 'set' command into the script gives only the system variables.

-If the same variables as for 'Send mail' and 'Send to Event Log' are used (using for example the following variables), the script do not run any more java script:emoticon(':blink:', 'smid_7')

:blink:, even if the script do not refers to the passed variables.

- [server]

- [source IO Owner]

- [Quota Path]

- [Quota Threshold]

Many thanks for any help,

java script:emoticon(':thumbup', 'smid_18')

:thumbup

Oli

Link to comment
Share on other sites

  • 1 month later...

I noticed the same problem. The specified command also seems not to run if you pass a "quoted string" as an argument. Anyone out there have any luck getting this to work? I'd really like to run a command with such variables as arguments.

Link to comment
Share on other sites

I figured it out!

For a BAT file, use this:

Command: C:\WINDOWS\system32\cmd.exe

Command arguments: /c C:\admin\notify.bat "Argument with space" [Quota Path] LastArg

Working directory: C:\admin

For a VBS script, use this:

Command: C:\WINDOWS\system32\cscript.exe

Command arguments: //nologo C:\admin\notify.vbs "Argument with space" [Quota Path] LastArg

Working directory: C:\admin

In both of the above cases, I was able to get "quoted arguments" and [FSRM Variables] to work as arguments to the scripts. To see a list of FSRM variables, run the following command:

dirquota notification /?

Note regarding permissions:

If you are running the command as LOCAL SERVICE or NETWORK SERVICE, you will need to make sure that account has read access to the command you are trying to run. Also, it will need write access to any files you want to write to. Note: If you give non-privileged accounts write access to the command file or directory, you will get an error saying "The specified path is insecure" and Event ID 12300 in Application Event Log. These accounts shouldn't need write access to the command or its directory. You can configure the command to run as SYSTEM, but don't use SYSTEM unless you really need to. I.e., don't just use it as an easy substitute for setting the correct file permissions.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...