Outlook 2011 - Self Service - Rebuild Database

mlitton
New Contributor II

I would like to add a self service feature to rebuild the database in Outlook 2011.

Is this something that can be run via script OR should I get self service to just 'open' the Microsoft Database Utility?

3 REPLIES 3

mm2270
Legendary Contributor III

I don't think the actual functions that the Microsoft Database Utility performs when doing a rebuild can be scripted. As far as I know, its a proprietary Microsoft app and doesn't have a command line equivalent that you can use in a script.
I'm also pretty sure it does more than just blow away the existing identity and rebuild it, so I wouldn't attempt to do a rebuild that way either. Your best bet will probably be to open the utility for the user and send up an instruction window on top of it explaining what they need to do.

danielc29
New Contributor III

Try this.

#! /bin/bash
# $3 is the logged in user - default for most policies.


sudo -u $3 /usr/bin/osascript <<ENDofOSAscript

display dialog "All Open Office Applications will now quit for Microsoft Outlook Database Rebuilding"
set apps to {"Microsoft Excel", "Microsoft PowerPoint", "Microsoft Word","Microsoft Outlook", "Microsoft Database Daemon"}
repeat with thisApp in apps
    tell application thisApp to quit
end repeat

tell application "Microsoft Database Utility"
    activate

    rebuild "Main Identity"

end tell

ENDofOSAscript

Exit 0

mlitton
New Contributor II

Thanks danielc29 ... I will try this on my test box.