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

> IXtfUserClient::DeleteUser

# IXtfUserClient::DeleteUser

Removes a user, specified by email address, from the console.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
public:
HRESULT DeleteUser(
         LPCWSTR userName
)  
```

<a id="parametersSection" />

### Parameters

*userName*\
Type: LPCWSTR

The email address used to add the user to the console.

<a id="retvalSection" />

### Return value

Type: HRESULT

HRESULT success or error code.

<a id="remarksSection" />

## Remarks

If a user is signed in to the console, the user is signed out before being removed.

To delete a user by specifying a user ID, use [DeleteUserId](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/deleteuserid-ixtfuserclient-xtfuser-xbox-windows-m).

To delete all users, use [DeleteAllUsers](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/deleteallusers-ixtfuserclient-xtfuser-xbox-windows-m).

To add a user, use [AddUser](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/adduser-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

- [IXtfUserClient::DeleteUserId](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/deleteuserid-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [IXtfUserClient::DeleteAllUsers](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/deleteallusers-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [XtfCreateUserClient](/reference/tools/xtf/xtfuser/methods/xtfcreateuserclient-xtfuser-xbox-windows-m.md)
- [IXtfUserClient::ListUsers](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/listusers-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [IXtfUserClient::SigninUser](/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/signinuser-ixtfuserclient-xtfuser-xbox-windows-m.md)
