Kill New-MailboxExportRequest in queue

fcbc
fcbc used Ask the Experts™
on
Issued a command to export a mailbox in powershell:

New-MailboxExportRequest -Mailbox <username> -BadItemLimit 5 -FilePath \\servername\c$\newfile.pst

Something happened where the job is just sitting in the queue. I have sense closed that powershell session so when I try to use the get-job status I get nothing because that only lists current shell pending jobs. However, if I use the Get-MailboxExportRequest, the job still shows as queued.

How do you delete a queued export command once the shell has been closed?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Solutions Architect
Commented:
Get-MailboxExportRequest | remove-MailboxExportRequest

will clear them all for you

closing powershell won't matter since it is a "Request" processed by the server

Author

Commented:
DUH! Didn't know that verb existed. I used:

Get-MailboxExportRequest -Status queued | Remove-MailboxExportRequest

and it prompts for the removal of each job in the queue.

Nice.

Thanks!
AkhaterSolutions Architect

Commented:
you are welcome

of course you can add -confirm:$false if you don't want to be prompted

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial