Skip to content

FSRMQuota

dscbot edited this page Jun 16, 2024 · 3 revisions

FSRMQuota

Parameters

Parameter Attribute DataType Description Allowed Values
Path Key String The path this FSRM Quota applies to.
Description Write String An optional description for this FSRM Quota.
Ensure Write String Specifies whether the FSRM Quota should exist. Present, Absent
Size Write SInt64 The size in bytes of this FSRM Quota limit.
SoftLimit Write Boolean Controls whether this FSRM Quota has a hard or soft limit.
ThresholdPercentages Write UInt32Array[] An array of threshold percentages in this FSRM Quota.
Disabled Write Boolean Disables the FSRM Quota applied to this path.
Template Write String The name of the FSRM Quota Template to apply to this path.
MatchesTemplate Write Boolean Causes the template to use only the template name and ignore Size, SoftLimit and ThresholdPercentage parameters.

Description

This resource is used to configures Quotas in File Server Resource Manager.

Examples

Example 1

This configuration will assign an FSRM Quota to the path 'D:\Users', with a Hard Limit of 5GB and threshold percentages of 85 and 100. An e-mail action is bound to each threshold. An event action is also bound to the 85 percent threshold.

Configuration FSRMQuota_Config
{
    Import-DscResource -Module FSRMDsc

    Node localhost
    {
        FSRMQuota DUsers
        {
            Path                 = 'd:\Users'
            Description          = '5 GB Hard Limit'
            Ensure               = 'Present'
            Size                 = 5GB
            SoftLimit            = $false
            ThresholdPercentages = @( 85, 100 )
        } # End of FSRMQuota Resource

        FSRMQuotaAction DUsersEmail85
        {
            Path       = 'd:\Users'
            Percentage = 85
            Ensure     = 'Present'
            Type       = 'Email'
            Subject    = '[Quota Threshold]% quota threshold exceeded'
            Body       = 'User [Source Io Owner] has exceed the [Quota Threshold]% quota threshold for quota on [Quota Path] on server [Server]. The quota limit is [Quota Limit MB] MB and the current usage is [Quota Used MB] MB ([Quota Used Percent]% of limit).'
            MailBCC    = ''
            MailCC     = '[email protected]'
            MailTo     = '[Source Io Owner Email]'
            DependsOn  = "[FSRMQuota]DUsers"
        } # End of FSRMQuotaAction Resource

        FSRMQuotaAction DUsersEvent85
        {
            Path       = 'd:\Users'
            Percentage = 85
            Ensure     = 'Present'
            Type       = 'Event'
            Body       = 'User [Source Io Owner] has exceed the [Quota Threshold]% quota threshold for quota on [Quota Path] on server [Server]. The quota limit is [Quota Limit MB] MB and the current usage is [Quota Used MB] MB ([Quota Used Percent]% of limit).'
            EventType  = 'Warning'
            DependsOn  = "[FSRMQuota]DUsers"
        } # End of FSRMQuotaAction Resource

        FSRMQuotaAction DUsersEmail100
        {
            Path       = 'd:\Users'
            Percentage = 100
            Ensure     = 'Present'
            Type       = 'Email'
            Subject    = '[Quota Threshold]% quota threshold exceeded'
            Body       = 'User [Source Io Owner] has exceed the [Quota Threshold]% quota threshold for quota on [Quota Path] on server [Server]. The quota limit is [Quota Limit MB] MB and the current usage is [Quota Used MB] MB ([Quota Used Percent]% of limit).'
            MailBCC    = ''
            MailCC     = '[email protected]'
            MailTo     = '[Source Io Owner Email]'
            DependsOn  = "[FSRMQuota]DUsers"
        } # End of FSRMQuotaAction Resource
    } # End of Node
} # End of Configuration

Example 2

This configuration will assign the '100 MB Limit' template to the path 'D:\Users'. It will also force the quota assigned to this path to exactly match the '100 MB Limit' template. Any changes to the thresholds or actions on the quota assigned to this path will cause the template to be removed and reapplied.

Configuration FSRMQuota_UsingTemplate_Config
{
    Import-DscResource -Module FSRMDsc

    Node localhost
    {
        FSRMQuota DUsers
        {
            Path            = 'd:\Users'
            Description     = '100 MB Limit'
            Ensure          = 'Present'
            Template        = '100 MB Limit'
            MatchesTemplate = $true
        } # End of FSRMQuota Resource
    } # End of Node
} # End of Configuration