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

# IXtfUserClient::PairControllerWithUserId Method

> IXtfUserClient::PairControllerWithUserId Method

# IXtfUserClient::PairControllerWithUserId Method

Pairs the user identified by the specified user ID to the controller with the specified controller ID.

## Syntax

```cpp theme={null}
public:
HRESULT PairControllerWithUserId(
         UINT32 userId,
         UINT64 controllerId
)  
```

### Parameters

*userId*\
Type: UINT32

The user ID of the user to pair with the controller.

*controllerId*\
Type: UINT64

The controller ID of the controller.

### Return value

Type: HRESULT

HRESULT success or error code.

## Remarks

To get the user ID of the user, call [ListUsers](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/listusers-ixtfuserclient-xtfuser-xbox-windows-m). In the returned [XTF\_USER\_DATA](/reference/tools/xtf/xtfuser/structures/XTF_USER_DATA-xtfuser-xbox-windows-t) structure, examine the *userId* member.

Pairing a controller by using **PairControllerWithUserId** is additive. If a user is already paired with the controller, the user specified by *userName* is also paired with the controller. To create an exclusive pairing, call **PairControllerWithUserIdExclusive** or **PairControllerWithUserExclusive**.

## Requirements

**Header:** xtfuser.h

**Library:** xtfuser.lib

**Supported platforms:** Windows (for XBOX console tools)

## See also

[PairControllerWithUser](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/paircontrollerwithuser-ixtfuserclient-xtfuser-xbox-windows-m)


## Related topics

- [IXtfUserClient::PairControllerWithUser Method](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/paircontrollerwithuser-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [IXtfUserClient::SignoutUserId](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/signoutuserid-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [IXtfUserClient::DeleteUserId](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/deleteuserid-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [IXtfUserClient::SigninUserId](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/signinuserid-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [IXtfUserClient::AddUser Method](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/adduser-ixtfuserclient-xtfuser-xbox-windows-m.md)
