---
title: "Users client"
slug: "users-client-1523404"
abstract: "Overview of the Users cient used to fetch users and user groups, and manage password operations."
---
# Users client

The SDK provides a `Users client` to fetch users and user groups by name and also features some password management operations.

> [!note]
> The `client` variable in the following code examples refers to the `IMClient` instance. When using the Web SDK, the variable name can be chosen freely, but it is also called `client` at instantiation in the documentation.

Users and user groups are entities that can be used with the querying client and the entities client.

## Get users

The `GetUserAsync` method gets a user by username. The following example fetches the user entity of the *superuser*:

```shell
IEntity superuser = await MClient.Users.GetUserAsync("superuser");

```

## Get user groups

The `GetUserGroupAsync` method gets a user group by name. The following example fetches the user group entity for the *superusers* group.

```shell
IEntity superusersGroup = await MClient.Users.GetUserGroupAsync("superusers");

```

## Set passwords

Superusers have the necessary privileges to set passwords for other users. Use the `SetPasswordAsync` method To change the password on a specific user:

```shell
await MClient.Users.SetPasswordAsync(100, "securepassword");

```

The first argument is the `id` of the user (for example, 100). The second argument is the new password.

## Reset passwords

Superusers also have the privilege to send 'password forgotten' e-mails to users. To do this, call the `ResetPasswordAsync` method with the id of the user. An e-mail is sent containing a unique and secure link to a page where the user can change their password.

```shell
await MClient.Users.ResetPasswordAsync(100);

```

> [!note]
> This feature only applies to users created and managed in Content Hub. It should not be used on users that are created and managed by a Single sign-on provider (SSO).