Deprecated - moved to https://github.com/PlagueHO/cFSRM repo.
PowerShell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
DSCResources
Examples
Tests/Unit
.gitignore
LICENSE
README.md
appveyor.yml
cFSRMQuotas.psd1

README.md

Build status

cFSRMQuotas

This module has been deprecated. It has been combined with the cFSRM Module. Please update your configurations to use this version.

The cFSRMQuotas module contains DSC resources for configuring Windows File Server Resource Manager Quotas, Auto Quotas and Quota Templates.

Contributing

Please check out common DSC Resources contributing guidelines.

Resources

  • cFSRMQuota configures FSRM Quotas.
  • cFSRMQuotaAction configures FSRM Quota Actions for Quotas.
  • cFSRMQuotaTemplate configures FSRM Quota Templates.
  • cFSRMQuotaTemplateAction configures FSRM Quota Template Actions for Quota Templates.
  • cFSRMAutoQuota configures FSRM Auto Quotas.

cFSRMQuota

  • Path: The path the quota is applied to. Required.
  • Description: The optional description of the quota. Optional.
  • Ensure: Should this quota exist. Optional. Values: { Absent | Present }. Default: Present
  • Size: Size of quota limit. Required.
  • SoftLimit: Specify if the limit is hard or soft. Optional. Detault: $Ture
  • ThresholdPercentages: An array of Threshold Percentages. Notifications can be assigned to each Threshold Percentage. Optional.
  • Disabled: Allows the quota to be disabled. Optional.
  • Template: The name of the Quota Template that should be used to create this quota. Optional.
  • MatchesTemplate: This parameter causes the resource to ignore the Size, Softlimit and ThresholdPercentages parameters and maintain the quota only using the Template. It should be enabled whenever possible as it simplifies the behaviour of the resource and will ensure the quota always matches the specified template. Optional.

cFSRMQuotaAction

  • Path: The path the quota is applied to for the action. Required.
  • Percentage: The threshold percentage that this action is assigned to. Required.
  • Type: The type of action. Required. Values: { Email | Event | Command | Report }.
  • Ensure: Should this quota/quota template action exist. Optional. Values: { Absent | Present }. Default: Present
  • Subject: The subject of the e-mail sent. Required when Type is Email.
  • Body: The body text of the e-mail or event. Required when Type is Email or Event.
  • MailBCC: The mail BCC of the e-mail sent. Required when Type is Email.
  • MailCC: The mail CC of the e-mail sent. Required when Type is Email.
  • MailTo: The mail to of the e-mail sent. Required when Type is Email.
  • Command: The Command to execute. Required when Type is Command.
  • CommandParameters: The Command Parameters. Required when Type is Command.
  • KillTimeOut: Int containing kill timeout of the command. Required when Type is Command.
  • RunLimitInterval: Int containing the run limit interval of the command. Required when Type is Command.
  • SecurityLevel: The security level the command runs under. Required when Type is Command. Values: { None | LocalService | NetworkService | LocalSystem }.
  • ShouldLogError: Boolean specifying if command errors should be logged . Required when Type is Command.
  • WorkingDirectory: The working directory of the command. Required when Type is Command.
  • EventType: The type of event created. Required when Type is Event. Values: { None | Information | Warning | Error }.
  • ReportTypes: Array of Reports to create. Required when Type is Report.

cFSRMQuotaTemplate

  • Name: The name of the quota template. Required.
  • Description: The optional description of the quota template. Optional.
  • Ensure: Should this quota template exist. Optional. Values: { Absent | Present }. Default: Present
  • Size: Size of quota limit. Required.
  • SoftLimit: Specify if the limit is hard or soft. Optional. Detault: $Ture
  • ThresholdPercentages: An array of Threshold Percentages. Notifications can be assigned to each Threshold Percentage. Optional.

cFSRMQuotaTemplateAction

  • Name: The name of the quota template for the action. Required.
  • Percentage: The threshold percentage that this action is assigned to. Required.
  • Type: The type of action. Required. Values: { Email | Event | Command | Report }.
  • Ensure: Should this quota template action exist. Optional. Values: { Absent | Present }. Default: Present
  • Subject: The subject of the e-mail sent. Required when Type is Email.
  • Body: The body text of the e-mail or event. Required when Type is Email or Event.
  • MailBCC: The mail BCC of the e-mail sent. Required when Type is Email.
  • MailCC: The mail CC of the e-mail sent. Required when Type is Email.
  • MailTo: The mail to of the e-mail sent. Required when Type is Email.
  • Command: The Command to execute. Required when Type is Command.
  • CommandParameters: The Command Parameters. Required when Type is Command.
  • KillTimeOut: Int containing kill timeout of the command. Required when Type is Command.
  • RunLimitInterval: Int containing the run limit interval of the command. Required when Type is Command.
  • SecurityLevel: The security level the command runs under. Required when Type is Command. Values: { None | LocalService | NetworkService | LocalSystem }.
  • ShouldLogError: Boolean specifying if command errors should be logged . Required when Type is Command.
  • WorkingDirectory: The working directory of the command. Required when Type is Command.
  • EventType: The type of event created. Required when Type is Event. Values: { None | Information | Warning | Error }.
  • ReportTypes: Array of Reports to create. Required when Type is Report.

cFSRMAutoQuota

  • Path: The path the auto quota is applied to. Required.
  • Ensure: Should this auto quota exist. Optional. Values: { Absent | Present }. Default: Present
  • Disabled: Allows the auto quota to be disabled. Optional.
  • Template: The name of the Quota Template that should be used to create this auto quota. Optional.

Versions

1.1.0.0

1.0.0.0

  • Initial release

Examples

Assign an FSRM Quota using a template

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 Sample_cFSRMQuota_UsingTemplate
{
    Import-DscResource -Module cFSRMQuotas

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

Assign a custom FSRM Quota

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 Sample_cFSRMQuota
{
    Import-DscResource -Module cFSRMQuotas

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

        cFSRMQuotaAction 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 = 'fileserveradmins@contoso.com'
            MailTo = '[Source Io Owner Email]'           
            DependsOn = "[cFSRMQuota]DUsers" 
        } # End of cFSRMQuotaAction Resource

        cFSRMQuotaAction 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 = "[cFSRMQuotaTemplate]DUsers" 
        } # End of cFSRMQuotaAction Resource

        cFSRMQuotaAction 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 = 'fileserveradmins@contoso.com'
            MailTo = '[Source Io Owner Email]'
            DependsOn = "[cFSRMQuotaTemplate]DUsers" 
        } # End of cFSRMQuotaAction Resource
    } # End of Node
} # End of Configuration

Configure an FSRM Quota Template

This configuration will create a FSRM Quota Template called '5 GB Hard Limit', 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 Sample_cFSRMQuotaTemplate
{
    Import-DscResource -Module cFSRMQuotas

    Node $NodeName
    {
        cFSRMQuotaTemplate HardLimit5GB
        {
            Name = '5 GB Limit'
            Description = '5 GB Hard Limit'
            Ensure = 'Present'
            Size = 5GB
            SoftLimit = $False
            ThresholdPercentages = @( 85, 100 )
        } # End of cFSRMQuotaTemplate Resource

        cFSRMQuotaTemplateAction HardLimit5GBEmail85
        {
            Name = '5 GB Limit'
            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 = 'fileserveradmins@contoso.com'
            MailTo = '[Source Io Owner Email]'           
            DependsOn = "[cFSRMQuotaTemplate]HardLimit5GB" 
        } # End of cFSRMQuotaTemplateAction Resource

        cFSRMQuotaTemplateAction HardLimit5GBEvent85
        {
            Name = '5 GB Limit'
            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 = "[cFSRMQuotaTemplate]HardLimit5GB" 
        } # End of cFSRMQuotaTemplateAction Resource

        cFSRMQuotaTemplateAction HardLimit5GBEmail100
        {
            Name = '5 GB Limit'
            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 = 'fileserveradmins@contoso.com'
            MailTo = '[Source Io Owner Email]'
            DependsOn = "[cFSRMQuotaTemplate]HardLimit5GB" 
        } # End of cFSRMQuotaTemplateAction Resource
    } # End of Node
} # End of Configuration

Configure an FSRM Auto Quota

This configuration will assign an FSRM Auto Quota to the path 'd:\users' using the template '5 GB Limit'.

configuration Sample_cFSRMAutoQuota
{
    Import-DscResource -Module cFSRMQuotas

    Node $NodeName
    {
        cFSRMAutoQuota DUsers
        {
            Path = 'd:\Users'
            Ensure = 'Present'
            Disabled = $false
            Template = '5 GB Limit'
        } # End of cFSRMAutoQuota Resource
    } # End of Node
} # End of Configuration

Links

  • GitHub Repo: Raise any issues, requests or PRs here.
  • My Blog: See my PowerShell and Programming Blog.