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

2 years, 10 months ago.

  • Author
  • #45316

    Topics: 1
    Replies: 0
    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.


  • #45408

    Topics: 13
    Replies: 4872
    Points: 1,811
    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.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort