No announcement yet.

Scripting Store defrag

  • Filter
  • Time
  • Show
Clear All
new posts

  • Scripting Store defrag

    Has anyone created a script that will dismount the "default store", run the eseutil and when completed, remount the "default store"? I have a late time window, usually 12-1:00am to start this process. When I have done this manually, it usually finished in 3-4 hours, so that it can be mounted before 6:00am. Thanks

  • #2
    You could look into this nice script:

    How to mount and dismount data stores via command line.:

    or this:

    Mounting and Dismounting Databases with CDOEXM:

    Then you can call another script that performs the defrag. BTW, I'm not sure why you'd want to perform this task on a regular basis, as defragging the stores is a task that should only be performed when there is good reason behind it, not as a day-to-day task.

    Daniel Petri
    Microsoft Most Valuable Professional - Active Directory Directory Services


    • #3
      I wasn't looking to do it daily, Unfortunately, my store is running anywhere from 13-16GB, and it goes down. My company will not allow me to limit mailbox sizes or force archiving or go to enterprise (cost). So, when it goes down, I start archiving on my own those that have over 400MB to pst files. This is when I want to run this to get back that space (consolidate) after I remove these emails. I should just say it can't come back up!! So I am looking for this to occur when the working shifts are over for the night and I do not have to be up to do it.