move mailbox script works ... but not as scheduled task
im using this script to move mailboxes from exchange 03 to my new exchange 07 environment: $users = get-content users.txt $users | Move-Mailbox -TargetDatabase "server\sg\db" -MaxThreads 10 -confirm:$false if i open the exchange management shell and run ".\script.ps1" it fires away no problem. if i create a new task in win srvr 2008 the script fails . again and again. can't seem to put my finger on it. any insight would be greatly appreciate. thanks !
March 30th, 2010 10:15pm

What does your .bat file and script look like? You need to either have the .bat file loading Powershell with the same path and command line options as the EMS shortcut, or you need to have the script load the Exchange snappin before you can use any of the Exchange specific cmdlets in the script if you're loading generic powershell.
Free Windows Admin Tool Kit Click here and download it now
March 30th, 2010 10:19pm

ive put this in "run" --> powershell -psconsolefile exshell.psc1 -command "& {c:\script.ps1}" ive put this path in "start in" ---> "C:\Program Files\Microsoft\Exchange Server\Bin"
March 30th, 2010 10:23pm

I usuall just do up a .bat file like this: C:\WINDOWS\system32\WindowsPowerShell\v1.0\PowerShell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1" -command "c:\scripts\script.ps1" and schedule the job to start in the scripts directory and run the .bat file.
Free Windows Admin Tool Kit Click here and download it now
March 30th, 2010 10:35pm

If you add start-transcript c:\somedir\transcript.txt to the beginning of your script, do you get a transcript file?
March 30th, 2010 10:36pm

had to remove the quotes from the start it path ... my bad. hahaah. thanks for the replies.
Free Windows Admin Tool Kit Click here and download it now
March 30th, 2010 10:43pm

*start in
March 30th, 2010 10:43pm

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

Other recent topics Other recent topics