Thursday, April 30, 2009

FSRM - "The command specified is under an insecure folder path"

Windows 2003 R2 and 2008 have a very cool feature - Quotas. Quotas have been around since NT4 on Windows Server but were always a bit rubbish - you had to set them by the volume and they didn't do much other than restrict file usage. 2003 R2 changed this with the File Server Resource Manager, included in 2008. FSRM is great - you can have "soft" quotas, essentially useful for reporting without restricting people, you can set different quotas on different folders, generate reports, launch programs, its great. I've been lobbying for it on the file servers at my current place since I arrived and it's making a big difference now they're in.

Saying that, I've just spent an outrageous amount of time getting quotas in FSRM to do something very basic - launch a program when a set percentage of a quota is hit. Whatever I selected I get the error "The command specified is under an insecure folder path". Google gave me nothing, something that really worried me! The program was just to send a message to HP OpenView to say there was a quota issue.

Turns out it was a couple of things. Firstly I was running the command as Local Service, which is nice and secure as it can't cause much damage but also didn't have file permission to the program it was launching. Sorted that and it still didn't work, so I directed it at a batch file intended to call the actual program and got the same error. Cue about an hour of changing permissions, running from different folders, hitting the screen, etc.

Finally on an obscure forum post I found the answer - I was calling the batch file wrong. You call CMD.exe and pass the name of the batch file as an argument, followed by any other arguments you want. It still won't look at the .exe under c:\program files but the batch file it looks at does it for it, including the arguments:

call opcmsg.exe %1 %2 %3 %4 %5 %6

Anyway, thought I should write this up in case someone else has the same issue, this took far too long! I get the impression not many people use the Command feature of FSRM, or if they do they found it a lot less fiddly than me...

Wednesday, April 22, 2009

Command line Server Manager on Windows 2008

Incredible! You can use a command line tool to install and remove system components. It even handles their dependancies and can handle system reboots as needed. Apparently if I ever used 2008 Core I would have had to use this years ago.

Another reason why Windows Server 2003 is - well, 6 years old and getting rubbish?

Run this to feel the love:

servermanagercmd -query