Run multiple commands sequentially in the Exchange Management Shell

snooflehammer
snooflehammer used Ask the Experts™
on
Need to export a bunch of mailboxes to PST files. I know the command for the Management Shell:

New-MailboxExportRequest -Mailbox "JohnSmith" -FilePath \\SERVERNAME\FOLDERNAME\JohnSmith.pst

How do I run 50 of these one after the other?

I assume I put all the command lines in a text file then somehow apply it so they all queue u.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Shaun VermaakTechnical Specialist
Awarded 2017
Distinguished Expert 2018

Commented:
I have seen background workers and threads for Powershell, will see if I am get a good example

Here is an application I wrote to do generic threading with any exe (including Powershell)
https://www.experts-exchange.com/articles/30139/How-to-thread-single-threaded-applications.html

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