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

# ListUsers

> IXtfUserClient::ListUsers

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

## Syntax

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

### Parameters

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

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

*pCount*\
Type: UINT32 \*

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

### Return value

Type: HRESULT

HRESULT success or error code.

## 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](https://docs.xbox.com/reference/tools/xtf/xtfuser/structures/XTF_USER_DATA-xtfuser-xbox-windows-t.md) 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](https://docs.xbox.com/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/adduser-ixtfuserclient-xtfuser-xbox-windows-m.md). To add a guest user, use [AddSponsoredUser](https://docs.xbox.com/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/addsponsoreduser-ixtfuserclient-xtfuser-xbox-windows-m.md).

## Requirements

**Header:** xtfuser.h

**Library:** xtfuser.lib

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

## See also

[IXtfUserClient interface](https://docs.xbox.com/reference/tools/xtf/xtfuser/classes/IXtfUserClient/ixtfuserclient-xtfuser-xbox-windows-t.md)


## Related topics

- [XTF_USER_DATA](https://docs.xbox.com/reference/tools/xtf/xtfuser/structures/XTF_USER_DATA-xtfuser-xbox-windows-t.md)
- [PairControllerWithUser](https://docs.xbox.com/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/paircontrollerwithuser-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [PairControllerWithUserId](https://docs.xbox.com/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/paircontrollerwithuserid-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [IXtfUserClient Interface (Interface contents)](https://docs.xbox.com/reference/tools/xtf/xtfuser/classes/IXtfUserClient/ixtfuserclient-xtfuser-xbox-windows-t.md)
- [ListUsersEx](https://docs.xbox.com/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/ixtfuserclient_listusersex.md)
