Q:

Failed to retrieve user profile using Search API by Birthday date filter after updating the Birthday property using Power shell

I have updated an user profile Birthday date using Powershell
Birthday format(MMM DD) Eg: February 15.
here is my script
 $adAccount = "domain\username"
 $up = $profileManager.GetUserProfile($adAccount)
 $up["SPS-Birthday"].Value = "February 15"
 $up.Commit()

Now I have run the Incremental call in search service application.
after that I browse the search api to retrieve the results whose Birthday from "February 05" to "February 20"
see url below
/_api/search/query?querytext='Birthday>="02-05-2000" AND Birthday<="02-20-2000"'&sourceid='b09a7990-05ea-4af9-81ef-edfab16c4e31'&selectproperties='AccountName,FirstName,Birthday'

I am unable to retrieve the profile which I was updated through powershell shown above in search api results. 
Please provide me solution for this...!

A:

Try with below powershell:
$adAccount = "domain\username"
$up = $profileManager.GetUserProfile($adAccount)

$birthday = "February 15"
$birthdayDateValue = "{0:dd MMM}" -f [datetime]$birthday
$up["SPS-Birthday"].Value = $birthdayDateValue

$up.Commit()

Check if the value is updated in the user's profile via Central admin.
Map the SPS-BirthDay property to one of the RefinableDate00 property as below (sorry for non-english screenshot) :

After that do a full crawl of the People content source.
Now modify your REST query as below:
/_api/search/query?querytext='*'&sourceid='b09a7990-05ea-4af9-81ef-edfab16c4e31'&selectproperties='AccountName,FirstName,RefinableDate00'&refinementfilters='RefinableDate00:range(datetime(02-05-2000), datetime(02-20-2000), from=\"ge\", to=\"le\")'"

Reference - Limit search results by exact time SP 2013
show upcoming birthdays based on sharepoint 2013 user profiles

