Shutdown Azure VM, only when no one is using it.

Welcome Forums General PowerShell Q&A Shutdown Azure VM, only when no one is using it.

This topic contains 1 reply, has 2 voices, and was last updated by

 
Keymaster
2 years, 5 months ago.

  • Author
    Posts
  • #45316

    Participant
    Points: 0
    Rank: Member

    Hello Everyone,

    I have scheduled the Start/Shutdown of VM through Azure Automation.Everything works fine.But, When user logged in to the machine and doing some work in the scheduled shutdown time,still it force the VM to shutdown.Is there any way I can tell the script to Shutdown the VM only when no one is connected/using?I have searched for it, but I am unable to get it.

    When I run Get-AzureVM. It provides other information not the one I am looking for.

    Thanks.

  • #45408

    Keymaster
    Points: 1,704
    Helping HandTeam Member
    Rank: Community Hero

    No, there isn't really a native way to do that. Azure kind of assumes that machines are "doing work" all the time, even if (as with a server) a user isn't logged in. The most you could probably do is hack together a logon/logoff script. The logon script disables the shutdown, the logoff script re-enables it. But that's going to be unreliable in some instances.

The topic ‘Shutdown Azure VM, only when no one is using it.’ is closed to new replies.