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

> IXtfUserClient::AddSponsoredUser

# IXtfUserClient::AddSponsoredUser

Adds a guest user.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
public:
HRESULT AddSponsoredUser(
         UINT32 *pUserId
)  
```

<a id="parametersSection" />

### Parameters

*pUserId*\
Type: UINT32 \*

On successful completion, points to the user ID of the guest user.

<a id="retvalSection" />

### Return value

Type: HRESULT

HRESULT success or error code.

<a id="remarksSection" />

## Remarks

Guest users, also known as *sponsored guests*, are associated with an account that is already signed in. When your code calls this method, the system uses the first signed-in user in the list as the sponsor and continues to use that user for all subsequent sponsored users. If the selected user signs out, all sponsored users are signed out at that time.

<Note>Unlike the UI used to add a sponsored user, this method does not have access to the XBOX Live privacy setting and online safety settings when it makes the selection.</Note>

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

For more information about guest users, see [Guest Users Overview](/build/core-features/common/user/users-guest-overview).

<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

- [IXtfUserClient::ListUsers](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/listusers-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [IXtfUserClient::AddUser Method](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/adduser-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [IXtfUserClient::SigninUser](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/signinuser-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [IXtfUserClient::DeleteUser](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/deleteuser-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [IXtfUserClient::SigninUserId](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/signinuserid-ixtfuserclient-xtfuser-xbox-windows-m.md)
