This project has moved. For the latest updates, please go here.

GetUserInfo Using PreferredName

May 28, 2013 at 2:44 PM
Hello, I'd like to use GetUserInfo to retrieve the WorkEmail of a user form Active Directory. The GetUserInfo function below looks up the user by the accountName. Is it possible to get the WorkEmail from AD using the PreferredName? The only information provided to my page is the user's name.
var $email;

    operation: "GetUserInfo",
    userLoginName: "SHARE1\\user",
    completefunc: function (xData, Status) {
        $(xData.responseXML).find("User").each(function() {
            $email = $(this).attr("Email");
May 29, 2013 at 3:43 AM

SPServices won't help you to interact with Active Directory, but if you have the right licensing you can query the User Profile Service.

Unfortunately, there's no operation in that Web Service to look up a user by PreferredName.