Giter VIP home page Giter VIP logo

azureautomation / stopvms--arm- Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 12 KB

Stops all the Azure VMs in a specific Azure Resource Group. This simple runbook stops all of the virtual machines in the specified Azure Resource Group. It is particularly useful for CSP (Cloud Solution Provider) customers, or users who have multiple subscriptions/tenants.

License: Other

PowerShell 100.00%
azureautomationrunbookgallery

stopvms--arm-'s Introduction

Stop-VMs (ARM)

.SYNOPSIS    

Stops all the Azure VMs in a specific Azure Resource Group

.DESCRIPTION   

This simple runbook stops all of the virtual machines in the specified Azure Resource Group. It is particularly useful for CSP (Cloud Solution Provider) customers, or users who have multiple subscriptions, as both Tenant ID and Subscription ID can be specified.

Note: Edit the $CredentialAssetName to match your Automation Credential Asset name. The account should have VM Contributor rights on the Resource Group you are targeting, or the ability to perform the “stop” VM action. More info on creating custom RBAC roles can be found here: https://azure.microsoft.com/en-us/documentation/articles/role-based-access-control-configure/#custom-roles-in-azure-rbac

.PARAMETER ResourceGroupName   

Required   

Name of the Azure Resource Group containing the VMs to be stopped.

.PARAMETER TenantID   

Required   

Tenant ID of the Azure account you are targeting (use Get-AzureRMSubscription to view). This should be provided in     the format xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx

.PARAMETER SubscriptionID   

Required   

Subscription ID of the Azure subscription that the Resource Group resides in (use Get-AzureRMSubscription to view).     This should be provided in the format xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx

.PARAMETER CredentialAssetName   

Required   

The name of the credential asset used to connect to the resource group. This must have at least Virtual Machine Contributor permissions.

.REQUIREMENTS    

This runbook makes use of the Azure Resource Manager PowerShell global module (now included    in Azure Automation)

.NOTES   

This runbook was originally created to power off Virtual Machines overnight and at weekends to prevent charging for     resources that are not needed 24x7, it is also ideal for Dev / Test labs.     It can easily be adapted to start Virtual Machines too by replacing Stop-AzureRMVM with Start-AzureRMVM.     The powering off of VMs works in parallel, but if you require certain machines to be powered off first before the workflow     begins, add them before the ForEach loop.

AUTHOR: Jay Avent    

LASTEDIT: March 30, 2016

 

 

TechNet gallery is retiring! This script was migrated from TechNet script center to GitHub by Microsoft Azure Automation product group. All the Script Center fields like Rating, RatingCount and DownloadCount have been carried over to Github as-is for the migrated scripts only. Note : The Script Center fields will not be applicable for the new repositories created in Github & hence those fields will not show up for new Github repositories.

stopvms--arm-'s People

Watchers

James Cloos avatar Azure Automation Product Team  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.