Skip to main content
Question

Outlook 2011 - Self Service - Rebuild Database

  • July 25, 2016
  • 3 replies
  • 18 views

mlitton
Forum|alt.badge.img+10

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

mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • July 25, 2016

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.


Forum|alt.badge.img+5
  • New Contributor
  • July 25, 2016

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
Forum|alt.badge.img+10
  • Author
  • Contributor
  • July 26, 2016

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