A script to increase FSRM report limit

A script to increase FSRM report limit

  • Comments 3
  • Likes

This script is provided "AS IS" with no warranties, and confers no rights.
For more information please visit
http://www.microsoft.com/info/cpyright.mspx to find terms of use.

-------------------------------------------------

const scriptName = "fsrmReportLimit"

DIM limitNames
limitNames = Array("MaxFiles", "MaxFileGroups", "MaxFileOwners", "MaxFilesPerFileGroup", "MaxFilesPerFileOwner", "MaxFilesPerDuplGroup", "MaxDuplicateGroups", "MaxQuotas", "MaxFileScreenEvents")

const optLimit = "/limit"
const optValue = "/value"

DIM objArgs, fsrm, strLimitName, strLimitValue

set objArgs = wscript.Arguments
if objArgs.count = 0 then
    PrintUsage()
    wscript.quit
end if

if objArgs.count = 1 then
    if objArgs(0) = "/?" then
        PrintUsage()
        wscript.quit
    end if
end if

DIM i, j
DIM strOption, strNewOption
DIM nModifyProperties
nModifyProperties = 0
for i = 0 to objArgs.count-1
    if (LCase(objArgs(i)) = optLimit) then
        strLimitName = objArgs(i+1)
        i = i + 1
    elseif (LCase(objArgs(i)) = optValue) then
        strLimitValue = objArgs(i+1)
        i = i + 1
    else
        wscript.echo "Error: invalid argument, " & objArgs(i)
        PrintUsage()
        wscript.quit
    end if
next

DIM limitNameCode
limitNameCode = -1
for i = LBound(limitNames) to UBound(limitNames)
    if (LCase(strLimitName) = LCase(limitNames(i))) then
  limitNameCode = i + 1
  exit for
    end if
next

if (limitNameCode = -1) then
    wscript.echo "Error: invalid limit name, " & strLimitName
    PrintUsage()
    wscript.quit
end if

set fsrm = WScript.createobject("fsrm.FsrmReportManager")

DIM newLimit
call fsrm.SetReportSizeLimit(limitNameCode, strLimitValue)
newLimit = fsrm.GetReportSizeLimit(limitNameCode)

if (Int(newLimit) = Int(strLimitValue)) then
    wscript.echo "Report size limit " & limitNames(limitNameCode - 1) & " was changed to " & strLimitValue
else
    wscript.echo "unable to change limit " & limitNames(limitNameCode - 1) & ".  Limit is set to " & newLimit
end if

function PrintUsage()
wscript.echo ""
wscript.echo scriptName & "  /limit <name> [/value <value>"
wscript.echo "         <name>  - name of the report size limit to modify"
wscript.echo "         <value> - new value for the size limit"
wscript.echo ""
wscript.echo "Report limit values:"
for i = LBound(limitNames) to UBound(limitNames)
    wscript.echo "    " & limitNames(i)
next
end function

-------------------------------------------------

This script is provided "AS IS" with no warranties, and confers no rights.
For more information please visit
http://www.microsoft.com/info/cpyright.mspx to find terms of use.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Can we get something like this for Server 2003 R2?

  • Did you ever wonder which files were taking up most of your space? How about which files no one has touched

  • FSRM はご存知でしょうか? ファイル サーバー リソース マネージャ です。Windows Server 2003 R2 から実装された機能で、ディレクトリレベルのクオーター管理機能やファイルスクリーン機能などが実装されています。無償で使えるすごく便利な機能なのですが、案外知られていないんですねぇ。