Resetting a Windows Server admin password
The first time you connect to the VM via RDP, 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. 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.
-
The
compute.adminservice role, theeditorprimitive role, or any other role that inherits all permissions of these two. For more information about roles, see Access management in Compute Cloud. -
VM with the
RUNNINGstatus.
To reset a password:
-
In the management console
, select your VM folder. -
Select Compute Cloud.
-
Select the VM.
-
At the top right, click
and select Reset password.Note
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.
-
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. -
Click Generate password.
-
Run PowerShell as an administrator.
-
Install the password reset module (once):
-
Install the CLI and configure it so that you can run commands as a user or service account with the required role (see above).
-
Run this command:
Install-Module -Name YCPasswordResetAnswer
Y(for "Yes") to installer questions, such as those regarding NuGet and repositories.
-
-
Run this command:
Reset-YCUserPassword -InstanceName <VM_name> -Username <VM_username>Note
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.
If there is no user with the name specified in the
-Usernameparameter on your VM, it will automatically be created with admin permissions.
Warning
Make sure to save the generated password, as it will not be shown again after you close the window.