I'm attempting to automate a few processes with the Exchange 2010 Scripting Agent, I want to disable several mailbox functions on creation (which works just fine) and automatically export a mailbox on remove request.
<?xml version="1.0" encoding="utf-8" ?>
<Configuration version="1.0">
<Feature Name="MailboxProvisioning" Cmdlets="new-mailbox">
<ApiCall Name="OnComplete">
if($succeeded) {
$newmailbox = $provisioningHandler.UserSpecifiedParameters["Name"]
set-casmailbox $newmailbox -OWAEnabled:$false -ActiveSyncEnabled:$false -ImapEnabled:$false -PopEnabled:$false
}
</ApiCall>
</Feature>
^ This all works
But the second section I'm wondering what ApiCall I need to use to run a command BEFORE the remove-mailbox command processed.
<Feature Name="MailboxProvisioning" Cmdlets="remove-mailbox">
<ApiCall Name="??????">
if($succeeded) {
$removedmailbox = $provisioningHandler.UserSpecifiedParameters["Name"]
New-MailboxExportRequest -Mailbox $removedmailbox -FilePath \\exchsrv\PSTFiles
}
</ApiCall>
</Feature>
</Configuration>
Any help would be greatly appreciated!