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

# DeleteUser

> IXtfUserClient::DeleteUser

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

## Syntax

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

### Parameters

*userName*\
Type: LPCWSTR

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

### Return value

Type: HRESULT

HRESULT success or error code.

## 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](https://docs.xbox.com/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/deleteuserid-ixtfuserclient-xtfuser-xbox-windows-m.md).

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

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

- [DeleteUserId](https://docs.xbox.com/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/deleteuserid-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [DeleteAllUsers](https://docs.xbox.com/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/deleteallusers-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [PlayFab Release Notes 2018](https://docs.xbox.com/services/playfab/release-notes/2018.md)
- [IXtfUserClient Interface (Interface contents)](https://docs.xbox.com/reference/tools/xtf/xtfuser/classes/IXtfUserClient/ixtfuserclient-xtfuser-xbox-windows-t.md)
- [DELETE /users/xuid(xuid)/lists/PINS/{listname}/RemoveItems](https://docs.xbox.com/reference/live/rest/uri/lists/uri-usersxuidlistspinslistnameremoveitemsdelete.md)
