It does not look like I can use $?, even if there is a error during the
export the results come back TRUE.
I might be able to use $error. I will probably have to do $error.clear()
before running the command.

Just curious if anyone else has this automated. Would it be easier to just
have powershell read the log file after every mailbox?






On Fri, May 7, 2010 at 12:13 AM, Joe Pochedley <joe.poched...@fivesgroup.com
> wrote:

>  Dig into the following powershell concepts:
>
>
>
> $?  Is a global variable that contains the execution status of the last
> command.  True – success, False - failed
>
> $error is a global variable that is an array of errors which have occurred
> in the current session.
>
>
>
> Those will tell you if the command completed with or without error….  Don’t
> know of a way to verify the PST integrity…   Maybe if you verify the size of
> the PST vs the mailbox size you can be at least reasonably sure the export
> was successful?
>
>
>
> HTH
>
>
>
> -JP
>
>
>
>
>
> *From:* Joseph L. Casale [mailto:jcas...@activenetwerx.com]
> *Sent:* Thursday, May 06, 2010 9:06 PM
>
> *To:* MS-Exchange Admin Issues
> *Subject:* RE: Another Export-Mailbox question
>
>
>
> Just test the command:
>
>
>
> If (blah…) { Do the rest..} etc
>
>
>
> *From:* KenM [mailto:kenmli...@gmail.com]
> *Sent:* Thursday, May 06, 2010 5:03 PM
> *To:* MS-Exchange Admin Issues
> *Subject:* Another Export-Mailbox question
>
>
>
> I am creating a powershell script that can export several mailboxes to PST
> of users that are going to be disabled and deleted. I know there is a XML
> and on screen logging when you run export-mailbox but is there any way to
> add error checking into a script that will verify the mailbox exported
> successfully? I want the script to be automated so if it fails on the PST
> export it will not do anything else to the account.
>

Reply via email to