Avatar of ams_group
ams_group
 asked on

Stop a Exchange Management Shell Script

Hi,

I'm wanting to test the following script which exports all mailboxes in a database to PST files. We are use Exchange 2010 SP1

foreach ($i in (Get-Mailbox -ResultSize Unlimited|Where {$_.Database -eq "Database Name"})) { New-MailboxExportRequest -Mailbox $i -FilePath "\\ServerName\pstexport_ctp \$($i.Alias).pst" }

Once the script starts processing mailboxes, how can it be stopped? Will simply closing the command Window do the trick? I only want it to run for long enough to ensure that it is working.

Thanks
ExchangePowershellWindows Server 2003

Avatar of undefined
Last Comment
ams_group

8/22/2022 - Mon
neilpage99

While the management shell window is open, hold down the <CTRL> key and press the "c" key. (i.e. CTRL+C). That will interrupt the processing of the script.
elevationkevin

I agree with neilpage99 but you can also just shut the machine down normally. Database copies won't go anywhere.
ASKER CERTIFIED SOLUTION
Neil Russell

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ams_group

ASKER
Thanks, -whatif worked a treat.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy