[Yandex Cloud documentation](../../../index.md) > [Yandex Compute Cloud](../../index.md) > [Step-by-step guides](../index.md) > Managing the password reset agent > Resetting the admin password

# Resetting a Windows Server admin password

The first time you [connect to the VM via RDP](../vm-connect/rdp.md), you need to reset the default admin password and generate a new one.

To reset a user password on a Windows Server VM, you need the following Yandex Cloud tools:

* [Password reset agent](../../concepts/guest-agent.md). The agent is part of default Windows Server images. If you are using a custom image, you will need to install the agent manually by following [this guide](install.md).

* The `compute.admin` service role, the `editor` primitive role, or any other role that inherits all permissions of these two. To learn more about roles, see [Access management in Compute Cloud](../../security/index.md).

* VM with the `RUNNING` [status](../../concepts/vm-statuses.md).

To reset a password:

{% list tabs group=programming_language %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select your VM folder.
  1. Navigate to **Compute Cloud**.
  1. Select the VM.
  1. At the top right, click ![image](../../../_assets/console-icons/ellipsis.svg) and select ![image](../../../_assets/console-icons/key.svg) **Reset password**.
  
      {% note info %}
  
      If the window that opens shows a message saying that the password reset agent is not running on the VM, make sure it is installed and check its runtime logs. For more information, see [Checking password reset agent operation on a Windows Server VM](check.md).
  
      {% endnote %}
  
  1. Specify the username to reset the password for. If there is no user with that name on your VM, it will be created automatically and get admin permissions.
  
      To reset the admin password, specify `Administrator`.
  
  1. Click **Generate password**.

- PowerShell {#powershell}

  1. Run PowerShell as an administrator.
  1. Install the password reset module (once):

      1. [Install the CLI and configure it](../../../cli/quickstart.md) so that you can run commands as a user or [service account](../../../iam/concepts/users/service-accounts.md) with one of the required roles (see above).
      1. Run this command:

          ```powershell
          Install-Module -Name YCPasswordReset
          ```

          Answer `Y` (for "Yes") to installer questions, such as those regarding NuGet and repositories.

  1. Run this command:

      ```powershell
      Reset-YCUserPassword -InstanceName <VM_name> -Username <VM_username>
      ```

      {% note info %}

      If a command takes too long to run, stop it with **Ctrl** + **C**. After you do this, verify that the password reset agent has been installed and check its logs. For more information, see [Checking password reset agent operation on a Windows Server VM](check.md).

      {% endnote %}

      If there is no user with the name specified in the `-Username` parameter on your VM, it will automatically be created with admin permissions.

{% endlist %}

{% note warning %}

Make sure to save the generated password, as it will not be shown again after you close the window.

{% endnote %}