Creating Passwords for Windows Instances

This guide shows you how to generate passwords for a Windows Compute Engine instance. To prevent unauthorized access to a new Windows instance, Compute Engine requires you to generate a new Windows password for that instance before you can connect to it. If you forget your password, you can generate a new one with this process.

Before you begin

You can generate Windows passwords using either the Cloud Platform Console or a gcloud command. Alternatively, you can generate passwords programmatically with API commands. If you forget your password, you can also use this procedure to reset it.

Console


In the Cloud Platform Console:

  1. Go to the VM instances page.

    VM instances page

  2. Click the Windows instance where you want to generate a new password.
  3. On the instance details page, click the Create or reset Windows Password button.
  4. The username field specifies which Windows user receives the new generated password. If you want to create a new user, specify a new username in this field and Compute Engine will add that user with a new password.
  5. Click Set.

gcloud


In gcloud, run the reset-windows-password command to generate a username and password:

gcloud compute reset-windows-password windows-instance

Resetting and retrieving password for example-user on windows-instance
Updated [https://www.googleapis.com/compute/v1/projects/example-user/zones/us-central1-f/instances/windows-instance].
ip_address: 130.211.133.229
password:   F0Lpj?5{*g.>5xT
username:   [USERNAME]

By default, gcloud generates a new password for the user who authenticated to gcloud. You can generate a password for another user by including the --user flag in the command. If the username does not exist, Compute Engine generates a new username and password for the instance with that username.

Compute Engine generates a random password, but you should change the password to a custom password that is meaningful to you. To set a custom password:

  1. Connect to your Windows instance using the generated password.
  2. After the desktop finishes loading, click the Start menu icon.
  3. Click Control Panel.
  4. Under the User Accounts icon, click either Change Account Type or Add or remove user accounts.
  5. Select the account that you want to modify.
  6. Click Change the password.
  7. Enter in your current password and your new password.
  8. Click Change password to save your changes.
  9. Test that your new password works by disconnecting and reconnecting to the instance using your new password.

What's next

Send feedback about...

Compute Engine Documentation