Script repository
The script returns checks if mailbox size exceeds a certain size limit. To execute the script, use the If PowerShell script returns true condition in a business rule, custom command or scheduled task configured for the required object type. The script returns $true if the specified limit is exceeded.
In the script, the $limitGigabytes variable specifies the mailbox size limit (in gigabytes).
$limitGigabytes = 2 # TODO: modify me
# Get mailbox size.
$mailboxParams = $Context.TargetObject.GetMailParameters()
$sizeInGBytes = $mailboxParams.UsageInfo.Size.GetGBytes()
$Context.ConditionIsMet = $sizeInGBytes -ge $limitGigabytes
Comments 0
You must be signed in to comment.