Hi @Indhu Manoharan ,
Rest API Id parameter not available to set with multiple values. As a workaround is to get the UserCollection in the group firstly and then put the user id in an array, loop the array to get user id and remove.
A code snippet for your reference:
ExecuteOrDelayUntilScriptLoaded(RemoveMultipleUsers, 'sp.js');
var userids=[12,13];
function RemoveMultipleUsers()
{
var clientContext = new SP.ClientContext("http://sp/sites/teams");
var oWeb = clientContext.get_web()
var collGroup = oWeb.get_siteGroups();
var oGroup = collGroup.getById(7); //Change 7 based on the group's id
var oUser = oGroup.get_users();
console.log(oUser);
clientContext.load(oUser);
for(var i=0;i<userids.length;i++)
{
oUser.removeById(userids[i]);
}
clientContext.executeQueryAsync(Function.createDelegate(this, onQuerySucceeded), Function.createDelegate(this, onQueryFailed));
}
function onQuerySucceeded(){
alert('User Removed');
}
function onQueryFailed() {
alert('Failed');
}
Replace all the userid which want to remove in the userids array and also the site url and group id, it will work as expected.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.