Hello Remco,
Yes, this can be done. You can use a PowerShell script that exports a mailbox to a PST file and add it to the Deprovision Custom Command with the help of the Run a program or PowerShell script action. However, there is one issue with such a solution. The thing is that exporting a PST can take quite long, and the script will 'hang' Adaxes until the mailbox is exported or until the 10-minute limit set for executing scripts in Adaxes gets expired. So, there is a possibility that if a mailbox is quite large, it will exceed the 10-minute limit.
To workaround the issue, we suggest the following approach: the Deprovision Custom Command will only start the mailbox export and then exit if the script doesn't complete in, let's say, 9 minutes. Also, a certain property of the user account will be modified to a certain value. The property will simply serve as a flag that the user's mailbox is being exported. For this purpose, you can use one of Adaxes virtual properties that can store boolean (true/False) values, for example, CustomAttributeBoolen1. Virtual properties are not stored in AD, but they can be used the same as any other properties of AD objects.
Also, you'll need to create a Scheduled Task that checks mailbox export requests for all users who have the flag set. As soon as mailbox export is complete, it will delete the user's account.
Will such a solution suit you? By the way, what do you mean by "the account should be deleted"? Does it mean that the user's account should be deleted from AD or that the mailbox associated with the user should be deleted from Exchange?