> ## 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.

# PFAccountManagementServerBanUsersAsync

> Bans users by PlayFab ID with optional IP address, for the provided game.

Bans users by PlayFab ID with optional IP address, for the provided game.

## Syntax

```cpp theme={null}
HRESULT PFAccountManagementServerBanUsersAsync(  
    PFEntityHandle titleEntityHandle,  
    const PFAccountManagementBanUsersRequest* request,  
    XAsyncBlock* async  
)  
```

### Parameters

**`titleEntityHandle`**   PFEntityHandle

PFEntityHandle for a title Entity obtained using PFAuthenticationGetEntityWithSecretKeyAsync.

**`request`**   [PFAccountManagementBanUsersRequest\*](/services/playfab/api-references/c/pfaccountmanagementtypes/structs/pfaccountmanagementbanusersrequest)

Populated request object.

**`async`**   XAsyncBlock\*<br />*Inout*

XAsyncBlock for the async operation.

### Return value

Type: HRESULT

Result code for this API operation.

## Remarks

This API is available on Win32, Linux, and macOS. The existence of each user will not be verified. When banning by IP, multiple players may be affected, so use this feature with caution. Returns information about the new bans. See also ServerGetUserBansAsync, ServerRevokeAllBansForUserAsync, ServerRevokeBansAsync, ServerUpdateBansAsync. When the asynchronous task is complete, call [PFAccountManagementServerBanUsersGetResultSize](/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementserverbanusersgetresultsize) and [PFAccountManagementServerBanUsersGetResult](/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementserverbanusersgetresult) to get the result.

## Requirements

**Header:** PFAccountManagement.h

## See also

[PFAccountManagement members](/services/playfab/api-references/c/pfaccountmanagement/pfaccountmanagement_members)
