Run multiple commands sequentially in the Exchange Management Shell

snooflehammer used Ask the Experts™
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.
Watch Question

Do more with

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

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)

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