The script removes all the trustees from the Send As list of a mailbox. To execute the script, create a business rule, custom command or scheduled task configured for the User object type.
Parameter:
- $pipelined - set to $true to update Exchange properties through Adaxes pipeline to create log records, apply business rules, security roles, etc. Set to $false to perform the update directly in Exchange (Adaxes functionality will not be applied).
PowerShell
# Bind to the user.
$user = $Context.BindToObjectByDNEx("%distinguishedName%", $True)
# Create an instance of the AdmExchangeMailboxParameters class.
$mailboxParams = New-Object "Softerra.Adaxes.Adsi.Exchange.AdmExchangeMailboxParameters"
$mailboxParams.SendAsModificationEnabled = $True
# Save changes
$user.SetMailParameters($mailboxParams, "ADM_SET_EXCHANGE_PARAMS_FLAGS_NONE")