Hello,
1. Yes, you can automatically send an an e-mail to the initiator with the help of a Business Rule and a Scheduled Task. You can create a Business Rule triggered After Moving the Exchange mailbox for the User. In the Business Rule, you can set a certain property of the user's account to the username of the initiator. It will serve as a flag indicating that the user's mailbox is being moved and will also store the initiator to be able to email the initiator later. For this purpose, you can use one of Adaxes virtual properties that can store text values, for example, CustomAttributeText1. Such virtual properties are not stored in AD, but you can use them as any other property of directory objects.
A Scheduled Task will check the mailbox move status of all the mailboxes for which the property is set. Once the status changes to Completed or any of the statuses stating the mailbox move status failed, the Scheduled Task will send an e-mail notification stating the status. It will also clear the virtual property not to process the mailbox any more.
If you are OK with such a solution, we will provide you with detailed instructions and a script that will be required for the Scheduled Task.
2. You cannot increase the time limit, but there is a workaround. In your Business Rule, Custom Command, Scheduled Task, you can create a separate PowerShell.exe process, and pass the script that you need to run as a parameter to PowerShell.exe. Since it will be a separate process, Adaxes will not control it, and the time limit will not apply. A drawback of this method is that you won't be able to view the warnings, errors or messages generated by the script. Also, you will not be able to update the Execution Log.
If such a solution is OK with you, here's a sample script that you can use as a guide. In the script, $scriptBlockToExecute specifies the actual script block that needs to be executed. Please remember, that in this script block, you need to escape all special characters used in PowerShell with a grave accent (`), such as $, @ etc.
The following script creates a separate PowerShell.exe process and passes a script to export the mailbox of the user, on which the script is executed, to a *.pst file located at \\server\ExportedMailboxes\%username%.pst, and exchangeserver.example.com specifies the fully qualified domain name (FQDN) of the Exchange server.
$scriptBlockToExecute = @"
& {
`$session = New-PSSession -configurationname Microsoft.Exchange -connectionURI http://exchangeserver.example.com/PowerShell
Import-PSSession `$session -DisableNameChecking
New-MailboxExportRequest %username% -FilePath \\server\ExportedMailboxes\%username%.pst -Name "%username%"
Remove-PSSession `$session
}
"@
$arguments = @("-noninteractive", "-noprofile", "-executionpolicy bypass", "-Command $scriptBlockToExecute", "> c:\1.txt")
$powershellPath = "$env:windir\syswow64\windowspowershell\v1.0\powershell.exe"
$starProcessInfo = New-Object System.Diagnostics.ProcessStartInfo
$starProcessInfo.FileName = $powershellPath
$starProcessInfo.Arguments = $arguments
$starProcessInfo.WindowStyle = "Hidden"
$starProcessInfo.CreateNoWindow = $True
$process = [System.Diagnostics.Process]::Start($starProcessInfo)
$process.WaitForExit(540000) # Wait for 9 minutes