Skip to main content

I can see Action "Office 365 add user to group" but not "Office 365 remove user from group".

 

Please let me know how to achieve it.

Hi! I am achieving it using "Web Request" action configured in the following way:

 

  1. URL: {Workflow Context:Current site URL}‍_vti_bin/UserGroup.asmx
  2. Method: SOAP 1.1
  3. SOAP action: http://schemas.microsoft.com/sharepoint/soap/directory/RemoveUserFromGroup
  4. Body: Content
    <?xml version="1.0" encoding="UTF-8"?>



    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <soap:Body>

    <RemoveUserFromGroup xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/">

    <groupName>NAME OF GROUP TO REMOVE USER FROM</groupName>

    <userLoginName>‍USER LOGIN THAT IS BEING REMOVED</userLoginName>

    </RemoveUserFromGroup>

    </soap:Body>

    </soap:Envelope>
  5. Then Username and Password of a user, who has permissions to add/remove users from the group - preferably someone from Owners group. Or Site Collection admin.

That's it. User login should be in the normal format with claims: i:0#.f|membership|user@email.com, or if you are using a People variable, then use "advanced lookup" and select "Login".

I hope this helps.

Best regards,
Tomasz


Thanks for the reply.
What should be the format of 'userLoginName' in case of external user, for example xyz@gmail.com


Hi,

you can notice that every external user has its own tenant-related login name, built in the following way:
xyz_gmail.com#EXT#@your-tenant-name.onmicrosoft.com.

So therefore you can try with that, but I haven't tried that so cannot tell if it works or not.

Regards,
Tomasz


Reply