How to: Create a Quota from the Command Line

Introduction

Quota Server comes with a set of command-line tools for manipulating Quota information. These tools are designed to be used in integration of quota policies with other applications or processes.

The command-line tools are located in the sub-directory Tools of your Quota Server installation directory. The exact syntax of each tool can be viewed by simply running the tool with no parameters. All tools can be used to manipulate Quotas on either a local computer or a remote computer.

QSSet sets a single Quota. An ideal example of when to use this tool is in your batch scripts when creating new users and home directories. The QSSet tool uses a file named SETTINGS.DEF, which contains default settings for a Quota. All of these default settings can be edited and over-ridden when QSSET is used. 

The command-line tools are written in C++ and use the Quota Server COM API. More information about the Quota Server COM API can be found in KB-2892.

Preparation

Registering the QSComApi.dll
All NSS command-line tools require that QSComApi.dll is registered. This is done by default during installation but a manual registration may be required in some cases. If the COM API is not registered the errors "Class not registered" or "Abnormal program termination" may be displayed when commands are executed.

64 bit QS COM API:
1. Open a Command Prompt at c:\windows\System32
2. Enter the command: Regsvr32 “C:\Program Files\NORTHERN\Storage Suite\QS\x64\QSComApi.dll”

32 bit QS COM API:
1. Open a Command Prompt at c:\windows\SysWOW64
2. Enter the command: Regsvr32 "C:\Program Files\NORTHERN\Storage Suite\QS\QSComApi.dll"

Registration of the QSComApi.dll on a remote host requires that certain files are first copied to that host. Consult KB-2875 for further details.

Editing the SETTINGS.DEF File
When using QSSET an object or path must be specified, this is the target of the quota. If QSSET is run with only the Object being specified then all other settings will be determined by the content of the SETTINGS.DEF file, as mentioned above.

All properties set in the SETTINGS.DEF file can be over-ridden when QSSET is used. Also the SETTINGS.DEF file can be edited directly to establish default quota settings that better fit the requirements in the deployment. The default path to the file is %ProgramFiles%\NORTHERN\Storage Suite\QS.

An example of the content of the SETTINGS.DEF file is as follows:

;AccessModel
;    0 Object
;    1 IntervaL
;    2 User
;    3 FileBlock
;    4 AutoUser
;    5 AutoDir  
;    6 AutoGroup
;    7 Remote AutoDir
;    9 Reverse File block
;
; ObjectIncludes, ObjectExcludes, AccountIncludes, AccountExcludes ; are using ? as a separator between different objects
; Use relative paths to the root path in ObjectIncludes and ObjectExcludes
;Platform
;    0 DAS
;    1 NetApp
;    2 EMC
;    3 NAS
;Usage Tracking
; 0 Logical
; 1 Physical

[general]
TestObjectExist = 0

[default quota settings]
Quota = 30000000
Account = Everyone
ExtQuota =
IncludeSubs = 1
AccessModel = 1
Interval = 600
Enabled = 1
ObjectType = 0

[default threshold settings]
Level1Enabled = 0
Level1Threshold = 75
Level1Action = 0
Level1UserNotify = 0
Level1AdminNotify = 1
Level2Enabled = 0
Level2Threshold = 90
Level2Action = 1
Level2UserNotify = 0
Level2AdminNotify = 1
Level3Enabled = 0
Level3Threshold = 100
Level3Action = 2
Level3UserNotify = 0
Level3AdminNotify = 1

[default notification settings]
FastLocking = 0
UserPopUp =
UserMail =
AdminPopup =
AdminMail =
UserExec =
UserExecParams =
AdminExec =
AdminExecParams =
NotifyUp = 1
NotifyDown = 0
RepeatNotify = 0
TemplateGroup = Standard

[custom]
Custom1 =
Custom2 =
Custom3 =

[Settings]
ObjectIncludes =
ObjectExcludes =
AccountIncludes =
AccountExcludes =
SmartColumnQuery1 =
SmartColumnQuery2 =
SmartColumnQuery3 =
SmartColumnQuery4 =
SmartColumnQuery5 =
CreatedTemplateName =
RevFBExtensions =
Platform =
SizeTrackingMethod =
UsageTracking =

[V9Settings]

NotifyNumContributors =
NotifyDeniedUsers =
QuotaTypeIndex =

Additional information about these settings and possible values is detailed in KB-2860.

Step-by-step

QSSET uses the following syntax:
QSSET object [/QS=nn] [/TC=xx] [/AC='xx'] [/UP=xx] [/UM='xx'] [/AP=xx] [/AM='xx'] [/UT=n]

Where:
object = the path or disk object to have the quota
[/QS=nn] = quota size in bytes
[/TC=xx] = target quota server server (if other than local)
[/AC='nn'] = user account (if other than 'Everyone')
[/UP=nn] = User popup recipient
[/UM='nn'] = User mail recipient
[/AP=nn] = Admin popup recipient
[/AM=nn] = Admin mail recipient
[/UT=n] = usage tracking method (0 for logical, 1 for physical)
-f  Force adding of path. Skips the resolving of path which is required for the remote quotas.

 

Examples of usage are as follows:
QSSET \\server12\d$\users\jane.doe /QS=1000000000 /TC=qsserver2
QSSET \\cifsserver2\homedir\arch.stanton /QS=1000000000 /TC=qsserver4 /UM='arch.stanton@sadhill.com'

Confirm results

Quotas created with QSSET will be displayed, as normal, in the Quota Server interface. Browse this interface to confirm the successful configuration of quotas.

ADDITIONAL RESOURCES

  • KB2860 What is/are: Low-level Quota Properties and Values
  • KB2875 How to: Registering QSComApi.dll on a remote machine
  • KB Article: 2829

    Updated: 9/3/2015

    • Category
      • Usage
    • Affected versions
      • NSS 9.0
      • NSS 9.5
      • NSS 9.6

    North America HQ

    NORTHERN Parklife, Inc.
    301Edgewater Place, Suite 100
    Wakefield, MA 01880
    USA

    Voice: 781.968.5424
    Fax: 781.968.5301

    salesUS@northern.net

     

    Additional Contact Information

    EMEA & APAC HQ

    NORTHERN Parklife AB
    St. Göransgatan 66
    112 33 Stockholm
    Sweden

    Voice: +46 8 457 50 00

    salesHQ@northern.net

    Northern Parklife



    ©2018 northern parklife

    privacy statement 
    terms of use