Stop Azure V2 VMs

This Graphical PowerShell runbook connects to Azure using an Automation Run As account and stops all V2 VMs in an Azure subscription or in a resource group or a single named V2 VM. You can attach a recurring schedule to this runbook to run it at a specific time.

 
 
 
 
 
4.3 Star
(24)
79,528 times
Add to favorites
Windows Azure
10/23/2016
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • How do I prevent "The pipeline was not run because a pipeline is already running." failures?
    2 Posts | Last post July 09, 2019
    • I've been trying to use this script to do nightly scheduled stops on multiple VMs, one at a time. Maybe 10% of the time, one or more of the scheduled scripts fail with the error:
      
        The pipeline was not run because a pipeline is already running.
        Pipelines cannot be run concurrently.
      
      Apparently, this is a known issue when trying to run multiple Powershell scripts at the same time. The work-around seems to be to avoid using pipelines, and to save the results in intermediate variables instead. But how does one change a Graphical "script" to use variables instead of pipelines?
      
      ~ Jeff Byers ~
    • Did you solve this ?
      
  • Subscription id is null
    1 Posts | Last post June 01, 2018
    • I am getting an error stating 'this.Client.SubscriptionId' cannot be null.  Where does this get read?  Connections in the automation account has AzureRunAsConnection which has subscriptionId set.  Is there any other place?
  • How do I prevent "The pipeline was not run because a pipeline is already running." failures?
    3 Posts | Last post September 07, 2017
    • I've been trying to use this script to do nightly scheduled stops on multiple VMs, one at a time. Maybe 10% of the time, one or more of the scheduled scripts fail with the error:
      
        The pipeline was not run because a pipeline is already running.
      
      Apparently, when trying to run multiple Powershell scripts at the same time, and the work-around seems to be to avoid using pipelines, and to same the results in variables. But how does one change a Graphical "script" to use variables instead of pipelines?
    • Hello,
      i'm encoutering same problem, did you find a solution ?
      
    • +1 to the random pipeline errors
      any ideas how to fix?
  • Schedules - ResourceGroupName parameter
    1 Posts | Last post May 25, 2017
    • Is there a way to enter multiple RG groups names in the ResourceGroupName parameter ?
  • How do I make this run on a single VM?
    1 Posts | Last post August 17, 2016
    • First of all, thanks for creating and sharing this runbook. 
      I've got it working for Resource Groups VMs.
      
      I'm trying to get it to work for a single VM. I'm not sure how to pass through the parameters:
      
      GetVirtualMachineInResourceGroupParamSet
      -Name <System.String>
      -ResourceGroupName <System.String>
      [-Status <System.Management.Automation.SwitchParameter>]
      
      
      Some guidance would be appreciated.
      
      Many Thanks