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

# DeleteUserId

> IXtfUserClient::DeleteUserId

# IXtfUserClient::DeleteUserId

從主機移除以使用者識別碼指定的使用者。

## 語法

```cpp theme={null}
public:
HRESULT DeleteUserId(
         UINT32 userId
)  
```

### 參數

*userId*\
類型：UINT32

要移除之使用者的使用者識別碼。

### 傳回值

類型：HRESULT

HRESULT 成功或錯誤碼。

## 備註

如果使用者已登入主機，則會在移除使用者之前將其登出。

若要透過指定電子郵件地址來刪除使用者，請使用 [DeleteUser](https://docs.xbox.com/zh-TW/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/deleteuser-ixtfuserclient-xtfuser-xbox-windows-m.md)。

若要刪除所有使用者，請使用 [DeleteAllUsers](https://docs.xbox.com/zh-TW/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/deleteallusers-ixtfuserclient-xtfuser-xbox-windows-m.md)。

若要新增使用者，請使用 [AddUser](https://docs.xbox.com/zh-TW/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/adduser-ixtfuserclient-xtfuser-xbox-windows-m.md)。

## 需求

**標頭：** xtfuser.h

**程式庫：** xtfuser.lib

**支援的平台：** Windows (適用於 XBOX 主機工具)

## 另請參閱

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


## Related topics

- [DeleteUser](https://docs.xbox.com/zh-TW/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/deleteuser-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [DeleteAllUsers](https://docs.xbox.com/zh-TW/reference/tools/xtf/xtfuser/classes/IXtfUserClient/methods/deleteallusers-ixtfuserclient-xtfuser-xbox-windows-m.md)
- [IXtfUserClient 介面 (介面內容)](https://docs.xbox.com/zh-TW/reference/tools/xtf/xtfuser/classes/IXtfUserClient/ixtfuserclient-xtfuser-xbox-windows-t.md)
- [DELETE (/users/xuid({xuid})/inbox/{messageId})](https://docs.xbox.com/zh-TW/reference/live/rest/uri/users/uri-usersxuidinboxmessageiddelete.md)
- [DELETE /titles/{titleId}/users/{xuid}/activities](https://docs.xbox.com/zh-TW/reference/live/rest/uri/multiplayeractivity/swagger-uris/uri-DeleteActivity.md)
