User's Properties from Active Directory can be achieved through profile synchronization.
- In Central Administration, verify settings on user profile service synchronization properties
- Run “User profile service synchronization" service. This will update all the user profile information
With the help of CSOM and REST API you can perform an activity to retrieve Hire date and birthday.
Internal name of hire date: “SPS-HireDate” and birthday : “SPS-Birthday”
Example:
var userProfileProperties;
// Ensure that the SP.UserProfiles.js file is loaded before the custom code runs.
SP.SOD.executeOrDelayUntilScriptLoaded(getUserProperties, 'SP.UserProfiles.js');
function getUserProperties() {
// Replace the placeholder value with the target user's credentials.
var targetUser = "domainName\\userName";
// Get the current client context and PeopleManager instance.
var clientContext = new SP.ClientContext.get_current();
var peopleManager = new SP.UserProfiles.PeopleManager(clientContext);
// Specify the properties to retrieve and target user for the
// UserProfilePropertiesForUser object.
var profilePropertyNames = ["SPS-HireDate", "SPS-Birthday"];
var userProfilePropertiesForUser =
new SP.UserProfiles.UserProfilePropertiesForUser(
clientContext,
targetUser,
profilePropertyNames);
// Get user profile properties for the target user.
// To get the value for only one user profile property, use the
// getUserProfilePropertyFor method.
userProfileProperties = peopleManager.getUserProfilePropertiesFor(
userProfilePropertiesForUser);
// Load the UserProfilePropertiesForUser object and send the request.
clientContext.load(userProfilePropertiesForUser);
clientContext.executeQueryAsync(onRequestSuccess, onRequestFail);
}
// This function runs if the executeQueryAsync call succeeds.
function onRequestSuccess() {
var messageText = "\"Hire date \" property is "
+ userProfileProperties[0];
messageText += "<br />\"DOB\" property is "
+ userProfileProperties[1];
$get("results").innerHTML = messageText;
}
// This function runs if the executeQueryAsync call fails.
function onRequestFail(sender, args) {
$get("results").innerHTML = "Error: " + args.get_message();
}
Reference:
http://www.c-sharpcorner.com/UploadFile/anavijai/how-to-get-a-particular-users-properties-using-csom-in-shar/
https://msdn.microsoft.com/en-us/library/office/jj920104.aspx
http://nikhilsarvaiye.blogspot.in/2013/09/sharepoint-2013-working-with-user.html
https://bramdejager.wordpress.com/2011/02/03/default-user-profile-properties/