RemoveUserCollectionFromSite Operation error

May 1, 2015 at 9:46 PM
What is the proper way to use "RemoveUserCollectionFromSite" operation? When we try to use it, we get the error:

<Users><User LoginName='i:0#.w|xxxxxxx></Users>
Finished Removing users from Site Collection. error

Here's the code we are using:
function DoRemove(inactiveUserLoginNames, URL)
{
    //another spServies query that removes all the users in the list
    cout (URL); 
    if(inactiveUserLoginNames.length == 0)
        return;
    var qstring = "<Users>"; //the xml query string of users to remove
    for(var i = 0; i < inactiveUserLoginNames.length; ++i)
    {
        qstring += "<User LoginName='" + inactiveUserLoginNames[i] + "'/>";
    }
    qstring += "</Users>";
    cout(qstring);
    
    $().SPServices({
          operation: "RemoveUserCollectionFromSite",
        userLoginNamesXml: qstring,
        webURL: URL,
          async: true,
        debug: true,
          completefunc: function(xData, Status) {
            cout("Finished Removing users from Site Collection. " + Status);
          }
    });


};
Any suggestions/assistance would be much appreciated.

Thanks!