How to check the Last Start of the server from Azure ConsoleHow to detect that azure application is running in development fabric?How to run application in azure emulator in development mode without visual studioAzure worker role failed to start due to “System.IO.FileNotFoundException”How to update Azure PowerShell?Azure Compute Emulator Wont StartHow to remove all deployed resources based on deployment name in AzureAzure Webjobs vs Azure Functions : How to chooseHow to configure public ip on azureStarting node server in azure batch startupproblems setting up two websites on azure server sharing assigned azure dns

On a tidally locked planet, would time be quantized?

Diode in opposite direction?

Does the Mind Blank spell prevent the target from being frightened?

Journal losing indexing services

How do I extrude a face to a single vertex

What is the gram­mat­i­cal term for “‑ed” words like these?

Can I use my Chinese passport to enter China after I acquired another citizenship?

Melting point of aspirin, contradicting sources

How do I repair my stair bannister?

MAXDOP Settings for SQL Server 2014

Why did the EU agree to delay the Brexit deadline?

Global amount of publications over time

Is there a conventional notation or name for the slip angle?

How can Trident be so inexpensive? Will it orbit Triton or just do a (slow) flyby?

Why does the integral domain "being trapped between a finite field extension" implies that it is a field?

Can someone explain how this makes sense electrically?

What linear sensor for a keyboard?

How can "mimic phobia" be cured or prevented?

Could solar power be utilized and substitute coal in the 19th century?

Difference between -| and |- in TikZ

Is it possible to use .desktop files to open local pdf files on specific pages with a browser?

Can I sign legal documents with a smiley face?

Proving a function is onto where f(x)=|x|.

If a character with the Alert feat rolls a crit fail on their Perception check, are they surprised?



How to check the Last Start of the server from Azure Console


How to detect that azure application is running in development fabric?How to run application in azure emulator in development mode without visual studioAzure worker role failed to start due to “System.IO.FileNotFoundException”How to update Azure PowerShell?Azure Compute Emulator Wont StartHow to remove all deployed resources based on deployment name in AzureAzure Webjobs vs Azure Functions : How to chooseHow to configure public ip on azureStarting node server in azure batch startupproblems setting up two websites on azure server sharing assigned azure dns













0















I have around 100 of servers in Azure, these Servers are used for DEV & UAT environments. I want to check when was these servers were lastly running. So that I can decide which servers to keep in Azure and delete if it's not in use.










share|improve this question






















  • Please check answer below to see if it works for you.

    – Ivan Yang
    Mar 12 at 6:04















0















I have around 100 of servers in Azure, these Servers are used for DEV & UAT environments. I want to check when was these servers were lastly running. So that I can decide which servers to keep in Azure and delete if it's not in use.










share|improve this question






















  • Please check answer below to see if it works for you.

    – Ivan Yang
    Mar 12 at 6:04













0












0








0








I have around 100 of servers in Azure, these Servers are used for DEV & UAT environments. I want to check when was these servers were lastly running. So that I can decide which servers to keep in Azure and delete if it's not in use.










share|improve this question














I have around 100 of servers in Azure, these Servers are used for DEV & UAT environments. I want to check when was these servers were lastly running. So that I can decide which servers to keep in Azure and delete if it's not in use.







azure azure-powershell azure-cli azure-compute-emulator






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 7 at 9:25









Raj NadarRaj Nadar

111




111












  • Please check answer below to see if it works for you.

    – Ivan Yang
    Mar 12 at 6:04

















  • Please check answer below to see if it works for you.

    – Ivan Yang
    Mar 12 at 6:04
















Please check answer below to see if it works for you.

– Ivan Yang
Mar 12 at 6:04





Please check answer below to see if it works for you.

– Ivan Yang
Mar 12 at 6:04












1 Answer
1






active

oldest

votes


















0














Please correct me if I misunderstand you.



Assume you have 100 azure vms(in one resource group) in running state, you want to check which vm is the last start one.



You can check the vm's Provisioning time, then add vm and provision time to a dictionary, then sort them by time.



$vms = Get-AzVM -ResourceGroupName "xxx"
$vm_info=@

foreach($vm in $vms)

$v1 = Get-AzVM -ResourceGroupName "xxx" -Name $vm.name -Status
$vm_info.add($vm.name,$v1.Statuses[0].Time)



#here, you can add your own code to sort the dictionary of $vm_info, like below:

$vm_info.GetEnumerator() | Sort-Object -Property value | select -Last 1





share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55040229%2fhow-to-check-the-last-start-of-the-server-from-azure-console%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Please correct me if I misunderstand you.



    Assume you have 100 azure vms(in one resource group) in running state, you want to check which vm is the last start one.



    You can check the vm's Provisioning time, then add vm and provision time to a dictionary, then sort them by time.



    $vms = Get-AzVM -ResourceGroupName "xxx"
    $vm_info=@

    foreach($vm in $vms)

    $v1 = Get-AzVM -ResourceGroupName "xxx" -Name $vm.name -Status
    $vm_info.add($vm.name,$v1.Statuses[0].Time)



    #here, you can add your own code to sort the dictionary of $vm_info, like below:

    $vm_info.GetEnumerator() | Sort-Object -Property value | select -Last 1





    share|improve this answer





























      0














      Please correct me if I misunderstand you.



      Assume you have 100 azure vms(in one resource group) in running state, you want to check which vm is the last start one.



      You can check the vm's Provisioning time, then add vm and provision time to a dictionary, then sort them by time.



      $vms = Get-AzVM -ResourceGroupName "xxx"
      $vm_info=@

      foreach($vm in $vms)

      $v1 = Get-AzVM -ResourceGroupName "xxx" -Name $vm.name -Status
      $vm_info.add($vm.name,$v1.Statuses[0].Time)



      #here, you can add your own code to sort the dictionary of $vm_info, like below:

      $vm_info.GetEnumerator() | Sort-Object -Property value | select -Last 1





      share|improve this answer



























        0












        0








        0







        Please correct me if I misunderstand you.



        Assume you have 100 azure vms(in one resource group) in running state, you want to check which vm is the last start one.



        You can check the vm's Provisioning time, then add vm and provision time to a dictionary, then sort them by time.



        $vms = Get-AzVM -ResourceGroupName "xxx"
        $vm_info=@

        foreach($vm in $vms)

        $v1 = Get-AzVM -ResourceGroupName "xxx" -Name $vm.name -Status
        $vm_info.add($vm.name,$v1.Statuses[0].Time)



        #here, you can add your own code to sort the dictionary of $vm_info, like below:

        $vm_info.GetEnumerator() | Sort-Object -Property value | select -Last 1





        share|improve this answer















        Please correct me if I misunderstand you.



        Assume you have 100 azure vms(in one resource group) in running state, you want to check which vm is the last start one.



        You can check the vm's Provisioning time, then add vm and provision time to a dictionary, then sort them by time.



        $vms = Get-AzVM -ResourceGroupName "xxx"
        $vm_info=@

        foreach($vm in $vms)

        $v1 = Get-AzVM -ResourceGroupName "xxx" -Name $vm.name -Status
        $vm_info.add($vm.name,$v1.Statuses[0].Time)



        #here, you can add your own code to sort the dictionary of $vm_info, like below:

        $vm_info.GetEnumerator() | Sort-Object -Property value | select -Last 1






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 7 at 10:27

























        answered Mar 7 at 10:17









        Ivan YangIvan Yang

        3,974128




        3,974128





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55040229%2fhow-to-check-the-last-start-of-the-server-from-azure-console%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            1928 у кіно

            Захаров Федір Захарович

            Ель Греко