Disable Shutdown button in windows
It’s very important at cloud, anyone with administrative access on windows can shutdown or restart remote desktop. This is convinience. However, it creates trouble as some might shutdown mistakenly the remote machine. It’s old problem, let’s solve with help of google cloud.
- Create instance of windows 2019 server
gcloud compute instances create instance-1 --project=my-project --zone=asia-south1-a --machine-type=e2-medium --network-interface=network-tier=PREMIUM,subnet=default --maintenance-policy=MIGRATE --service-account=852070526974-compute@developer.gserviceaccount.com --scopes=https://www.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/service.management.readonly,https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://www.googleapis.com/auth/trace.append,https://www.googleapis.com/auth/devstorage.read_only --create-disk=auto-delete=yes,boot=yes,device-name=instance-1,image=projects/windows-cloud/global/images/windows-server-2019-dc-v20211216,mode=rw,size=50,type=projects/awacs-dev/zones/asia-south1-a/diskTypes/pd-balanced --no-shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring --reservation-affinity=any
2. Reset/set windows password
gcloud beta compute — project “my-project” reset-windows-password “instance-1” — zone “asia-south1-a”
3. Disable access
Still in gpedit.msc, go to Computer Configuration / Windows Settings / Security Settings / Local Policies / User Rights Assignment, edit the “Shut down the system” privilege and remove “Users” from the list.
4. verify login to windows server
C:\Windows\system32>shutdown -s -t 0
Access is denied.(5)