Link to home
Start Free TrialLog in
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
Avatar of neilpage99
neilpage99
Flag of United States of America image

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.
I agree with neilpage99 but you can also just shut the machine down normally. Database copies won't go anywhere.
ASKER CERTIFIED SOLUTION
Avatar of Neil Russell
Neil Russell
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ams_group
ams_group

ASKER

Thanks, -whatif worked a treat.