Stay organized with collections Save and categorize content based on your preferences.
Windows
By default, Windows virtual machine (VM) instances authenticate by using a username and a password instead of by using SSH. If you don't enable SSH for Windows, you must generate new credentials before connecting to the VM. This document describes how to generate credentials and manage accounts on Windows VMs.
You can also use this process to generate new credentials if you no longer have the original credentials. If you use this process to generate new credentials for existing users, any data that is encrypted with the current credentials, such as encrypted files or stored passwords, might not be retained.
Caution: If the VM is running an Active Directory domain controller, generating new credentials can cause the password of an existing domain user to be reset or a new domain user to be created. To prevent credential generation, disable the account manager. Accounts disabled by defaultThe following accounts are built-in to Windows Server and are disabled by default:
Administrator
Guest
DefaultAccount
WDAGUtilityAccount
For these accounts, the Windows guest agent can reset the credentials. Resetting the credentials won't do the following:
The built-in accounts are not guaranteed to have the default names because the local security policy, which is used by many organizations, can rename the accounts. If the accounts were renamed, you can use the original names.
Before you beginSelect the tab for how you plan to use the samples on this page:
ConsoleWhen you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
gcloudInstall the Google Cloud CLI. After installation, initialize the Google Cloud CLI by running the following command:
gcloud init
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update
.To get the permissions that you need to generate credentials for Windows Server VMs, ask your administrator to grant you the following IAM roles:
roles/compute.instanceAdmin.v1
) on the VM or projectroles/iam.serviceAccountUser
) on the service account or projectFor more information about granting roles, see Manage access to projects, folders, and organizations.
You might also be able to get the required permissions through custom roles or other predefined roles.
Generate credentialsGenerate credentials for Windows Server VMs by using the Google Cloud console or the Google Cloud CLI.
Note: Before you can generate credentials for VMs that you imported to Compute Engine, you must enable the COM4 port in the Windows Device Manager. ConsoleGo to the VM instances page.
Click the Windows Server VM to change the password on.
On the VM instance details page, in Remote access, click Set Windows password.
In the Username field, enter the username to change the password for, or enter a new username to create a new user.
Click Set.
Run the following gcloud compute reset-windows-password
command:
gcloud compute reset-windows-password VM_NAME
Replace VM_NAME
with the name of the VM to change the password for.
Review the information in the confirmation prompt:
This command creates an account and sets an initial password for the user [username] if the account does not already exist. If the account already exists, resetting the password can cause the LOSS OF ENCRYPTED DATA secured with the current password, including files and stored passwords. For more information, see: https://cloud.google.com/compute/docs/operating-systems/windows#reset Would you like to set or reset the password for [username] (Y/n)?
After confirming the previous prompt, review the confirmation of new credentials, which appears as follows:
Resetting and retrieving password for [username] on [instance-name] Updated [https://www.googleapis.com/compute/v1/projects/project-name/zones/zone/instances/instance-name]. ip_address: ip-address password: password username: username
You can now connect to the instance by using the new credentials.
After you connect to your Windows Server VM, you can use the Windows Command Prompt or the Windows user interface to change your password.
Command PromptUse the net user
command to change the password.
After the desktop finishes loading, click the Start menu icon.
Click Control Panel.
Under the User Accounts icon, click either Change Account Type or Add or remove user accounts.
Select the account that you want to modify.
Click Change the password.
Enter your current password and your new password.
Click Change password to save your changes.
After the desktop finishes loading, click the Start menu icon.
Click Settings.
Click Accounts.
Click Sign-in options.
Under Password, click Change.
Enter your current password and click Next.
Enter your new password in the New password field and enter it again in the Re-enter password field.
Enter a Password hint, and click Next.
Click Finish.
After the desktop finishes loading, click the Start menu icon.
Click Settings.
Click Accounts.
Click Sign-in options.
Click Password and click Change.
Enter your current password and click Next.
Enter your new password in the New password field and enter it again in the Confirm password field.
Enter a Password hint, and click Next.
Click Finish.
Use the net user
to create a new user.
Example:
net user USERNAME PASSWORD /add
Replace USERNAME
with your username and PASSWORD
with your password of choice.
After the desktop finishes loading, click the Start menu icon.
Click Control Panel.
Under the User Accounts icon, click either Change Account Type or Add or remove user accounts.
Click Add a user account.
Set the username, password and password hint, then click Next.
After an account is created click Finish.
After the desktop finishes loading, click the Start menu icon.
Click Settings.
Click Accounts.
Click Other users, then Add someone else on this PC.
Skip all the Microsoft account related steps and click Add a user without a Microsoft account.
Set the username, password and password hint, then click Next.
After the desktop finishes loading, click the Start menu icon.
Click Settings.
Click Accounts.
Click Other users, then Add someone else on this PC.
Skip all the Microsoft account related steps and click Add a user without a Microsoft account.
Set the username, password and password hint, then click Next.
Adding a local account to the Administrator group will give you administrative privileges on your Windows VM. See more information on Local Accounts
.
Use the net localgroup
to add a user to the Administrator group.
Example:
net localgroup administrators USERNAME /add
Replace USERNAME
with the username of choice.
/add
with /delete
if you want to remove a user from the local administrator group. Windows Server 2016
After the desktop finishes loading, click the Start menu icon.
Click Control Panel.
Under the User Accounts icon, click either Change Account Type or Add or remove user accounts.
Select the account that you want to change.
Click Change the account type.
Select Administrator and confirm by clicking Change Account Type.
After the desktop finishes loading, click the Start menu icon.
Click Settings.
Click Accounts.
Click Other users then click the account that you want to change.
Click Change account type.
From the drop-down, select the Administrator account type and click OK.
After the desktop finishes loading, click the Start menu icon.
Click Settings.
Click Accounts.
Click Other users then click the account that you want to change.
Click Change account type.
From the drop-down, select the Administrator account type and click OK.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["Windows VMs default to username and password authentication, requiring credential generation if SSH is not enabled or if original credentials are lost."],["Generating new credentials for existing users may result in the loss of data encrypted with the current credentials and can cause domain user issues if the VM is running an Active Directory domain controller."],["Built-in Windows accounts like `Administrator` and `Guest` are disabled by default, and while credentials can be reset, they won't be automatically enabled or granted sign-in access."],["Credentials for Windows Server VMs can be generated through the Google Cloud console or the Google Cloud CLI, and it's important to note that imported VMs may need the COM4 port enabled."],["Once logged into your VM, you can change the password of your user, add new local users, or add a user to the administrator group through the Command Prompt or the Windows Server UI."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4