Resetting a user password on a Windows Server VM
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.admin
service role, theeditor
primitive 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
RUNNING
status.
To reset a password:
-
Select the folder the VM belongs to.
-
Select Compute Cloud.
-
Select the VM.
-
Click 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 automatically be created with admin permissions.
-
Click Generate password.
-
Save the New password, as it will not be shown again after you close the window.
-
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 YCPasswordReset
Answer
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
-Username
parameter on your VM, it will automatically be created with admin permissions. -
Save the generated password as it will not be shown again after you close the window.