Launching Exchange Mass Export via the Scheduler

Hello,

I have installed this very useful script (MassExport.ps1) on an Exchange server. 
Related links : MassExport on www.stevieg.org   &   MassExport on Technet

Launched from a Command Prompt (using administrator account), the bat script it works fine.
I also executed the command "New-ManagementRoleAssignment Role "Mailbox Import Export" User <Your Admin User>"

However, I cannot run it from the Scheduler; the script always stop after a few seconds...

I tried many configurations :
- Launch it using Administrator account (even not connected) or System account
- Use of "
Run with highest privileges"
- Launch a bat script, or only Powershell with full command in Argument
- With or without "Start in" parameter

And nothing works...

Could you please help me to have this script scheduled ?

Thanks in advance.


  • Edited by Athena0501 Thursday, April 02, 2015 6:37 PM
April 2nd, 2015 6:25pm

I found the answer.

Add this line at the beginning of the PowerShell script :

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn
(first line for Exchange 2010, second for 2013).
  • Marked as answer by Athena0501 21 hours 34 minutes ago
Free Windows Admin Tool Kit Click here and download it now
April 3rd, 2015 5:51am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics