SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to get the currently logged user’s colleague list using ECMA client script?

Used the below script to pull the currently logged user name:

                <script type="text/javascript">
                    ExecuteOrDelayUntilScriptLoaded(getWebUserData, "sp.js");  
                    var context = null;
                    var web = null;
                    var currentUser = null;
                        function getWebUserData() {
                            context = new SP.ClientContext.get_current();
                            web = context.get_web();
                            currentUser = web.get_currentUser();
                            context.executeQueryAsync(Function.createDelegate(this, this.onSuccessMethod), Function.createDelegate(this, this.onFailureMethod));
                        function onSuccessMethod(sender, args) {
                            var userObject = web.get_currentUser();
                            alert('User name:' + userObject.get_title() + '\n Login Name:' + userObject.get_loginName());
                        function onFailureMethod(sender, args) {
                            alert('request failed ' + args.get_message() + '\n' + args.get_stackTrace());
share|improve this question
up vote 0 down vote accepted

I don't think it is possible with ECMA as it allows only a limited functionalities, HttpHandler would a solution.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.