fsrmquota action workaround

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Eric Gustafson Eric Gustafson 1 month, 2 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #50499
    Profile photo of Eric Gustafson
    Eric Gustafson
    Participant

    I'm trying to set a new quota (or re-set existing) and the set-fsrmquota doesn't appear to support the -action param like set-fsrmquotatemplate. All my quotas are custom and do not use a template. My understanding was that if you create a quota of a template and then change the template, the quotas created off that template would change also. Is that a misconception on my part? If so, I may have my workaround by creating a temporary template, create quota based on the template, then delete the template.
    If not, can anyone suggest a workaround?

    here's basically what I'm tyring to do: (btw, I use the description field to hold emails of quota contact personnel that are not necessarily the same as who receives the quota notification messages. I also change the default notification email from [Admin] to specific email addresses that are not specified anywhere else )

    $action= New-FsrmAction set-fsEmail -mailto $quotanotify -Subject "[Quota Threshold]% quota threshold exceeded." -Body "User [Source Io Owner] has exceeded the [Quota Threshold]% quota threshold for the quota on [Quota Path] on server [Server].  The quota limit is [Quota Limit MB] MB, and [Quota Used MB] MB currently is in use ([Quota Used Percent]% of limit)."
    $threshold = New-FSRMquotathreshold -percentage 95
    Set-FsrmQuota -cimsession $server -path $sharepath -size $quota -Description $quotanotify -threshold $threshold -Action $action
    
    • This topic was modified 1 month, 2 weeks ago by Profile photo of Eric Gustafson Eric Gustafson. Reason: change blockquote to pre
    #50631
    Profile photo of Matt Bloomfield
    Matt Bloomfield
    Participant

    Your understanding is correct. You have three options after editing a template, you can do nothing to existing quotas and just have all new quotas match the template; you can update all existing quotas that were derived from the template, including those that have been modified; or you can update existing quotas that match the original template, leaving modified quotas untouched.

    Edit Quota Template Properties – Technet

    The PowerShell parameters for Set-FsrmQuotaTemplate that control the behaviour are UpdateDerived and UpdateDerivedMatching.

    Set-FsrmQuotaTemplate Help

    #50900
    Profile photo of Eric Gustafson
    Eric Gustafson
    Participant

    ok, with that in mind here's an update that works.:

    $action= New-FsrmAction Email -MailCC "[Source Io Owner Email]" -mailto $quotanotify -Subject "[Quota Threshold]% quota threshold exceeded." -Body "User [Source Io Owner] has exceeded the [Quota Threshold]% quota threshold for the quota on [Quota Path] on server [Server].  The quota limit is [Quota Limit MB] MB, and [Quota Used MB] MB currently is in use ([Quota Used Percent]% of limit)." -CimSession $server
    $threshold = New-FSRMquotathreshold -percentage 95 -CimSession $server -action $action
    New-FsrmQuotaTemplate -cimsession $server -size $quota -name "STANDARD" -Threshold $Threshold
    New-FsrmQuota -cimsession $server -path $sharepath -size $quota -Description $quotanotify -template "STANDARD"
    Remove-FsrmQuotaTemplate -Name "STANDARD" -CimSession $server -force
    

    Is there a way to check the checkbox for 'send e-mail to the user who exceeded the threshold' option that's viewable/available in the fsrm gui? It's currently getting added in the additional e-mail headers section which I'd prefer not to use.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.