We use cookies to improve your experience.
By your continued use of this site you accept such use.
For more details please see our privacy policy and cookies policy.

Script Repository

Check mailbox size

February 24, 2021 Views: 2109

The script can be used in business rules, custom commands and scheduled tasks to check user mailbox size. It returns True if the mailbox size exceeds a certain limit. To use the script in your rule, command or task, add the If PowerShell script returns true condition.

Parameter:

  • $limitGigabytes - Specifies the mailbox size limit (in gigabytes).
Edit Remove
PowerShell
$limitGigabytes = 2 # TODO: modify me

# Get Exchange properties
$mailboxParams = $Context.TargetObject.GetMailParameters()

# Get mailbox size
$sizeInGBytes = $mailboxParams.UsageInfo.Size.GetGBytes()

$Context.ConditionIsMet = $sizeInGBytes -ge $limitGigabytes

Comments 0
Leave a comment
Loading...

Got questions?

Support Questions & Answers