> ## 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::ListUsers

> IXtfUserClient::ListUsers

# IXtfUserClient::ListUsers

Returns a list of all users currently associated with this console.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
public:
HRESULT ListUsers(
         XTF_USER_DATA **ppUserData,
         UINT32 *pCount
)  
```

<a id="ID4EG" />

<a id="parametersSection" />

### Parameters

*ppUserData*\
Type: XTF\_USER\_DATA \*\*

On successful return, points to an array of [XTF\_USER\_DATA](/reference/tools/xtf/xtfuser/structures/XTF_USER_DATA-xtfuser-xbox-windows-t) objects describing users currently associated with the console.

*pCount*\
Type: UINT32 \*

On successful return, the count of elements in the *ppUserData* array.

<a id="ID4EP" />

<a id="retvalSection" />

### Return value

Type: HRESULT

HRESULT success or error code.

<a id="remarks" />

<a id="remarksSection" />

## Remarks

Your calling code is responsible for freeing the memory associated with *ppUserData* by using `CoTaskMemFree`.

If a user is a sponsored (guest) user, the value of `szEmailAddress` in the [XTF\_USER\_DATA](/reference/tools/xtf/xtfuser/structures/XTF_USER_DATA-xtfuser-xbox-windows-t) object is an empty string, and `szGamertag` is derived from the gamertag of the sponsoring user.

If a user has never been signed in on this console, `szGamertag` is an empty string.

To add a user to this console, use [AddUser](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/adduser-ixtfuserclient-xtfuser-xbox-windows-m). To add a guest user, use [AddSponsoredUser](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/addsponsoreduser-ixtfuserclient-xtfuser-xbox-windows-m).

<a id="requirementsSection" />

## Requirements

**Header:** xtfuser.h

**Library:** xtfuser.lib

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

<a id="seealsoSection" />

## See also

[IXtfUserClient interface](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/ixtfuserclient-xtfuser-xbox-windows-t)


## Related topics

- [XTF_USER_DATA](/reference/tools/xtf/xtfuser/structures/XTF_USER_DATA-xtfuser-xbox-windows-t.md)
- [IXtfUserClient::ListUsersEx](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/ixtfuserclient_listusersex.md)
- [IXtfUserClient::PairControllerWithUser Method](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/paircontrollerwithuser-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [IXtfUserClient::PairControllerWithUserId Method](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/paircontrollerwithuserid-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [IXtfUserClient::AddSponsoredUser](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/addsponsoreduser-ixtfuserclient-xtfuser-xbox-windows-m.md)
