> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PFLobbyForceRemoveMember

> PFLobbyForceRemoveMember reference in the PlayFab Multiplayer C++ SDK, letting the lobby owner forcibly remove another PlayFab entity from a lobby it owns.

Forcibly remove an entity from the lobby.

## Syntax

```cpp theme={null}
HRESULT PFLobbyForceRemoveMember(  
    PFLobbyHandle lobby,  
    const PFEntityKey* targetMember,  
    bool preventRejoin,  
    void* asyncContext  
)  
```

### Parameters

**`lobby`**   PFLobbyHandle

The handle of the lobby.

**`targetMember`**   [PFEntityKey\*](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/pfentitykey_clientsdk)

The member to forcibly remove.

**`preventRejoin`**   bool

A flag indicating whether `targetMember` will be prevented from rejoining the lobby after being removed.

**`asyncContext`**   void\*\
*optional*

An optional, app-defined, pointer-sized context value that can be used to associate the completion state change with this call.

### Return value

Type: HRESULT

`S_OK` if the call succeeded or an error code otherwise. The human-readable form of the error code can be retrieved via [PFMultiplayerGetErrorMessage()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayergeterrormessage).

## Remarks

This is an asynchronous operation. Upon successful completion, the title will be provided a [PFLobbyMemberRemovedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbymemberremovedstatechange) followed by a [PFLobbyForceRemoveMemberCompletedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyforceremovemembercompletedstatechange) with the [PFLobbyForceRemoveMemberCompletedStateChange::result](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyforceremovemembercompletedstatechange) field set to `S_OK`. Upon a failed completion, the title will be provided a [PFLobbyForceRemoveMemberCompletedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyforceremovemembercompletedstatechange) with the [PFLobbyForceRemoveMemberCompletedStateChange::result](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyforceremovemembercompletedstatechange) field set to a failure hresult. <br /><br /> One of the local PlayFab entities present in this lobby must be the owner for this operation to succeed. If the local owning entity who initiated this operation loses their ownership status while the operation is in progress, the operation will fail asynchronously.   <br /><br /> This is an asynchronous operation. The member removed via this method will not be removed from the lists returned by [PFLobbyGetMembers](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pflobbygetmembers) until the asynchronous operation successfully completes and a `PFLobbyMemberRemovedStateChange` struct is provided by [PFMultiplayerStartProcessingLobbyStateChanges](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayerstartprocessinglobbystatechanges).

## Requirements

**Header:** PFLobby.h

## See also

[PFLobby members](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/pflobby_members)


## Related topics

- [PFLobbyMemberRemovedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbymemberremovedstatechange.md)
- [Use lobby and matchmaking together](/services/playfab/multiplayer/lobby/lobby-and-matchmaking.md)
- [PFLobbyGetMemberConnectionStatus](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pflobbygetmemberconnectionstatus.md)
- [PFLobbyStateChangeType](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/enums/pflobbystatechangetype.md)
- [PFMultiplayer C/C++ API overview - PFLobby.h](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/pflobby_members.md)
