0
votes

Is there any way to reset the password on a GCE Windows instance (Server 2008 R2). I have an old password in a snapshot that I'm creating an instance from and I can't RDP into it.

I can create a disk from the snapshot and attach that to another instance but can't see a way to reset the password.

Any help would be appreciated.

2

2 Answers

0
votes

You can retrieve your username and password from the metadata server, using the gcloud compute instances describe command, visit this link for more information. If the password is expired, the RDP client will ask you to change the password.

0
votes

Someone from Google gave me a workaround in a Google Group. Just needed to run:

gcloud compute instances add-metadata <INSTANCE> --zone <ZONE> --metadata windows-startup-script-cmd="net user <USERNAME> <PASSWORD>"

and then reboot!