Rebuilding Outlook Spotlight index via self-service?


We seem to have an awful lot of users that experience searching issues in Outlook 2016. Rebuilding the Outlook spotlight index followed by a reboot seems to resolve the issue, but it would be helpful to make the rebuild available as a self-service item. Does anyone know how I could script the command below to automatically pull in the locally logged in username whenever the user runs the policy in self-service?

mdimport -g /Applications/Microsoft Outlook Spotlight Importer.mdimporter -d1 /Users/localusername/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile

One potential wrinkle is that the user would need some indication that the indexing had completed and the machine should be restarted.


New Contributor III

If you’re running a script via the jamf binary then it automstically populates $1, 2 and 3

$1 is the mount point $2 is the hostname of the machine
$3 is the current user

In terms of notifying the user you can make the reboot part of your policy and then under ‘user interaction’ (I think that’s right I’m not currently looking at a JSS) you can write s notification to say why the machine is rebooting and to give them the option to defer the reboot etc if it’s not a convenient time to reboot.



FYI - there are now some official outlook tools that were released recently, one of which specifically deals with this search issue in outlook 2016. See[](link URL)

I haven't tested the search fix on a user's computer yet, just on my mac, but you should be able to deploy the utility via self service.

Contributor II

Hi @sag969,

Thank you very much! I didn't know these tools.