powershell - Dump PST and DeleteContent after dump -


I am trying to dump a user's PST file and removing the content using Exchange 2013.

I understand these two processes and there is no problem in executing it.

I create a new mailboxexport to pst dump and I do the item search-mailbox. -Delatentant This is not a problem at all.

The problem I have is that these 2 commands are tied in a .ps1 file. This file is scheduled to run daily.

Sometimes MailboxExportRequest takes an unusually long queue and executes (sometimes 15-20 minutes). My fear is that these 2 scripts are being bundled together, my dumps are being removed before it starts.

How do I stop it?

Therefore, if I remember my exchange 2010 class correctly, then the New MailboxExportRC Mailboxx exportsRejectExposition is. Can not you store it in a variable, and then start the loop for a while, which sleeps for 30 seconds until the work is done? Something like this:

  $ MailExport = New-Mailbox Exporterix-FilePoint & lt; Path & gt; -Mailbox SomeGuysMailboxID while (Get-MailboxExportRequest -Id $ MailExport) .set -unit "full") {start-sleep-30} search-mailboxes ... -Delentent   

Or if it does not return any object, you can specify a name for it, I'm pretty sure, and then get position by the job name, in any way you can simply check the status and sleep You can put the sleep command in order to wait until the work is started D.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -