Most SharePoint devs out there know about trimming navigation items based on audience trimming settings. This has been around since I’ve been using SharePoint, back in the dark-dark times of SharePoint 2007.
It usually just works. Add a link or folder to the site’s navigation, set which audience should see the link, and done. People in the “Analytics” group see the link or folder, lesser privileged individuals do not. It’s like magic, without all the magical mumbo-jumbo.
In fact, it’s so dead simple, it’s the last thing I expected to have a problem. So … what’s this crazy exception message I’m seeing when setting audience trimming??
This entry cannot be validated. Exception “Object reference not set to an instance of an object.” occurred.
Cannot be validated object reference what-what?
First of all, thank you for the amazingly useless exception message. It’s nothing new to developers in most any stack, but I thank you anyway.
So why is it not working? Who’s fault is it? Is SharePoint bugged? Is Mars in retrograde? Did I configure something wrong? If I did, can I blame my parents because they never gave me a RC car for Christmas? (Turns out I can, and have. Next stop: therapy.)
As it turns out, it was mostly my fault. In order for audience trimming to work the User Profile Service has to be activated and fully configured.
How do I activate and configure the User Profile Service?
This is the easy-peasy part. First of all:
- Go to Central Administration
- Go to System Settings
- Go to Services on Server
- Look for the following:
- Start that turkey
Now that the service is started on the farm, provision the User Profile Service (seems backwards, but whatever). Rather than re-typing this next part all out, I direct you to this stellar post on configuring the service: http://jaxsharepoint.blogspot.com/2013/08/setup-and-start-sharepoint-2013-user.html
Unless you need it for other reasons, stop before provisioning the User Profile Synchronization Service. This is not needed to get audience trimming running.
If I could draw one conclusion for you, it would look like this:
Keep going …