Diwali in the Cloud | GSP093

Solution for Diwali in the Cloud | GSP093. 1 lab: GSP093. Fast copy-paste commands for Google Cloud.

GSP093 — Compute Engine: Qwik Start - Windows

Estimated time: 15 minutes

# 🚀 Compute Engine: Qwik Start - Windows | GSP093 > ⚠️ **Disclaimer:** This is an independent, community-made walkthrough created for educational purposes, hands-on practice, and Google Cloud certification preparation. This guide helps learners understand Windows Server provisioning and administration using Google Cloud Compute Engine. Always attempt the lab yourself first and follow Google Cloud Skills Boost / Qwiklabs Terms of Service. This walkthrough is not affiliated with or endorsed by G

clear
ORANGE=

\033[38;5;208m'
CYAN=

\033[0;36m'
GREEN=

\033[0;32m'
YELLOW=

\033[0;33m'
MAGENTA=

\033[0;35m'
BLUE=

\033[0;34m'
BOLD=

\033[1m'
RESET=

\033[0m'

echo "${CYAN}${BOLD}"
echo "   ____        _   _ _            __   ___              "
echo "  / __ \      | | (_) |          / _| / _ \             "
echo " | |  | |_ __| |__  _| |_  ___   | |_ | | | |_ __ ___  "
echo " | |  | | '__| '_ \| | __| / _ \ |  _|| | | | '_ \ / __| "
echo " | |__| | |  | |_) | | |_ | (_) || |  | |_| | |_) \__ \ "
echo "  \____/|_|  |_.__/|_|\__| \___/ |_|   \___/| .__/|___/ "
echo "                                            | |         "
echo "                                            |_|         "
echo "${RESET}"
echo "${MAGENTA}${BOLD}==========================================================${RESET}"
echo "${MAGENTA}${BOLD} STAGE 1: Windows Server VM Deployment & Password Reset   ${RESET}"
echo "${MAGENTA}${BOLD}==========================================================${RESET}"

echo "${YELLOW}▶ Checking project and zone configuration...${RESET}"
export PROJECT_ID=$(gcloud config get-value project 2>/dev/null)
export ZONE=$(gcloud compute project-info describe --format="value(commonInstanceMetadata.items[google-compute-default-zone])" 2>/dev/null)
if [ -z "$ZONE" ]; then
  export ZONE=$(gcloud config get-value compute/zone 2>/dev/null)
fi
if [ -z "$ZONE" ]; then
  read -p "${BLUE}${BOLD}Enter your assigned ZONE (e.g., us-central1-a): ${RESET}" ZONE
fi
echo "${CYAN}Project : ${PROJECT_ID}${RESET}"
echo "${CYAN}Zone    : ${ZONE}${RESET}"

echo "${YELLOW}▶ Creating Windows Server VM instance 'instance-1'...${RESET}"
gcloud compute instances create instance-1 --project=$PROJECT_ID --zone=$ZONE --machine-type=e2-medium --image-family=windows-2022 --image-project=windows-cloud --boot-disk-size=50GB --boot-disk-type=pd-balanced --quiet 2>/dev/null || true

echo "${GREEN}✓ Windows Server VM created.${RESET}"
echo "${YELLOW}▶ Waiting for Windows Guest Agent & resetting 'admin' password...${RESET}"

until gcloud compute reset-windows-password instance-1 --zone=$ZONE --user=admin --quiet 2>/dev/null; do
  echo "${CYAN}  ...Windows Guest Agent is still initializing. Retrying in 15 seconds...${RESET}"
  sleep 15
done

echo "${GREEN}${BOLD}✓ Windows password reset completed successfully.${RESET}"
echo "${ORANGE}${BOLD}You may now click 'Check my progress' in your lab manual.${RESET}"
echo "${MAGENTA}${BOLD}==========================================================${RESET}"