I am trying to retrieve user properties for various users using the GetPropertiesFor method of the sp.userprofiles RESTful API. Through a lot of testing, I discovered that I could only retrieve properties for users that have logged into a SharePoint site in the Farm at least once. The JSON object that returns for users that have not logged in at least once looks like this:
data : {
config: {..},
data: {
d: {
GetPropertiesFor: null
}
},
status: 200,
statusText: "OK"
}Meanwhile, the JSON object that is returned for users that had previously logged in looks like this:
data : {
config: {..},
data: {
d: {
AccountName: domain/username,
DisplayName: "John Doe",
etc.
}
},
status: 200,
statusText: "OK"
}I confirmed the that the return hinged on whether the user had logged in or not by querying a test account that had not been used. The JSON return looked like the first example above. I then logged into a site with that test account, and tested the query again. This time, the test account's properties and values returned, like in the second example. I have searched at length to see if others have experienced this and have found nothing. I need to be able to return user properties and user profile properties for users that have not logged in. Thanks in advance.