0

I am using below code for removing user from particular group using SPServices.

In complete function alert is showing success, but in XData it is displaying User does not exist or is not unique. I don't know what I am missing in this code.

Any idea?

 function removeUserFromGroup(user, groupname) {

                var con = confirm('Are you sure to delete this user');
                if (con == true) {

                            $().SPServices({
                                operation: "RemoveUserFromGroup",
                                groupName: groupname,
                                userLoginName: user,
                                async: false,
                                completefunc: function (xData, Status) {
                                    alert("success");
                                }

                            });
                            //return true;   
                        }
                else
                    return false;
            }
  • How are you passing "user" value ... can you provide test values – Monica Jagani May 5 '16 at 5:07
  • Is your user value in this format : DOMAIN\\User_Alias ? – Monica Jagani May 5 '16 at 5:09
  • am getting login name like this "i:0#.w|inashok.kulkarni" – chakri May 5 '16 at 5:13
  • for test purpose try to input the user value as "DOMAIN\\User_Alias" format to test the code. – Monica Jagani May 5 '16 at 5:14
  • for test puporse am passing "IN\\ashok.k", then also am facing same error – chakri May 5 '16 at 5:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.