0

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.

alan
  • 4,247
  • 7
  • 37
  • 49

2 Answers2

0

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.

Marilu
  • 963
  • 6
  • 7
  • That just gets me password generated when the instance was created from the snapshot. This doesn't work. It's possible that I previously had to change the password within Windows before I took the snapshot... would this cause the default password reset mechanisms of GCE not to work? – alan Oct 15 '14 at 16:25
0

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!

alan
  • 4,247
  • 7
  • 37
  • 49