Script Repository


Modify Storage Quotas after adding a user to a group

February 18, 2021
1232

The script modifies mailbox storage quotas after adding a user to a group.

To use the script with Adaxes, you need to create a business rule triggered after adding a member to a group that runs the script using the Run a program or PowerShell script action.

For more information on setting mailbox storage quotas using Adaxes ADSI API, see Mailbox Usage.
Edit Remove
PowerShell
# Bind to the new group member
$newMemberPath = "Adaxes://%member%"
$newMember = $Context.BindToObject($newMemberPath)

$mailboxProps = New-Object "Softerra.Adaxes.Adsi.Exchange.AdmExchangeMailboxParameters"
$mailboxProps.StorageQuotas.IsModificationEnabled = $True
$mailboxProps.StorageQuotas.UseDatabaseQuotaDefaults = $False
$mailboxProps.StorageQuotas.IssueWarningQuota = New-Object "Softerra.Adaxes.Adsi.Exchange.AdmByteQuantifiedSize" 4244635648
$mailboxProps.StorageQuotas.ProhibitSendQuota = New-Object "Softerra.Adaxes.Adsi.Exchange.AdmByteQuantifiedSize" 5242880000
$mailboxProps.StorageQuotas.ProhibitSendReceiveQuota = New-Object "Softerra.Adaxes.Adsi.Exchange.AdmByteQuantifiedSize" 5242880000
$newMember.SetMailParameters($mailboxProps, 0)

Comments ( 0 )
No results found.
Leave a comment