Showing Birthdays and Job Anniversaries in the Newsfeed
By Anatoly Mironov
In our project we have a requirement to show birthdays and job anniversaries in the Newsfeed. The solution is simple (when you know it) but there has not been any information about it online, until today. I want to share a few lines of PowerShell code to enable Anniversary notifications in the Newsfeed. This desired piece of code was written by my colleague Emma Degerman. Enjoy:
[source language=“PowerShell”] $job = Get-SPTimerJob | ? { $_.TypeName -like “*.UserProfileChangeJob” } $job.GenerateAnniversaries = $true $job.Schedule = [Microsoft.SharePoint.SPSchedule]::FromString(“hourly between 55 and 55”) $job.Update() [/source]
The code retrieves the Timer Job that changes User Profiles, sets “GenerateAnniversaries” to true, then it updates the schedule to run it before the Activity Feed Timer Job and updates it. By the way, it is only applicable for SharePoint On Premises.
This is it, a quick tip for a great Intranet.
Comments from Wordpress.com
Anatoly Mironov - Nov 1, 2014
Hi m00ntear, in my intranet, the birthdays are saved in the format: “February 13”. There is no year. Try that. On an anniversary an entry in the user’s microfeed is created. Just to investigate why it doesn’t work, try following: Find a “test person”, update his or her birthday to November 24. Trigger manually those timer jobs sequentially in the following order: 1. User Profile Service Application - User Profile Change Job 2. User Profile Service Application - Activity Feed Job Then go to the profile page for that test person. An entry should show up in the Activity Feed: Happy birthday, Test Person…. In your newsfeed the birthdays will show up only for people who you follow (correct if I am wrong).
Huh, weird, It actually does work! But your additional information certainly does help for later debugging and with other customers. Good to know that I would just have to set a birthday to the current date and re-run the timer jobs for it to show up. Saw the first birthday happening today, and yes you are right you only see birthdays of people you are following on your Newsfeed.
Cool! I am glad that it works. Thank you for your feedback. I’ll update my post with the additional information needed to get it up and running.
Interesting! I tried looking through the stored procedure responsible for doing the Generation as manually executing the timer job doesn’t propagate birthdays for me. In my environment no birthdays show up, even though the property Birthday exists for all users and is filled with dates such as this: 19.11.2014, 20.11.2014 (so correct dates, year = this year). Is it different in your environment? Do the birthdays only show up for people I follow? Do the birthdays only show up once a day?
When I try this is the error PowerShell returns $job.GenerateAnniversaries = $true Property ‘GenerateAnniversaries’ cannot be found on this object; make sure it exists and is settable.
I just tried this approach and it didn’t work for me running 1. User Profile Service Application – User Profile Change Job 2. User Profile Service Application – Activity Feed Job after I changed the test user’s birthday to May 5 I’ll appreciate your assistance. Thanks