I'm running Windows Updates on my Azure Windows Server 2016 VM that are taking too much time. How can I have VM auto-stop after updates are installed (instead of me keep checking if the updates are done)?


In Azure VM , as I known, there is no more ways to do it. Other choice is to make your own calculation of how many time it could delay the installation. You can create a batch file (or just WinKey+R) with this command: shutdown -s -t n where n is the time in seconds that system will be delay to shutdown. As note, you can use shutdown -r -t n where -r indicates a restart.

Hope this helps!

  • Voting down because shutdown of the guest OS will not save any Azure costs. You have to stop the VM from the portal to save costs. I believe this concern is implied in the question but the Op can confirm. – GregGalloway Nov 26 '17 at 2:10
  • @GregGalloway Yes, the concern is about Azure costs meter keep running while I'm still waiting the OS Windows Server 2016 updates are still running - and I would like to know how to have VM stopped automatically after Updates are done instead of me keep waiting for updates to be done so I could manually stop the VM from portal. – nam Dec 10 '17 at 6:14
  • Hi,@GregGalloway and nam. Deallocating Azure VM can save cost. you can scheduler your VM from Azure portal, but as my answer said, you cannot automatically shutdown your VM after updating. – Wayne Yang Dec 11 '17 at 2:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.