Forum Discussion
美奈 堀内
Nov 27, 2017Copper Contributor
Azure Automation Script
Hi there,
I would like to start my machines by automation.
I used to success to start and stop by powershell workflow script. but it was for the machine that deployed Classic.
Now i would ...
David Delorge
Dec 01, 2017Copper Contributor
Here is a simple Script that works in ARM: ##Login to Azure ARM ##This
script gathers information about Azure ARM REsources $azureAccountName
="youraccount@yourdns.onmicrosoft.com" $azurePassword =
ConvertTo-SecureString "xxxxx" -AsPlainText -Force $psCred = New-Object
System.Management.Automation.PSCredential($azureAccountName,
$azurePassword) Add-AzureRmAccount -Credential $psCred ##Switch
Subscriptions and set subscriptions Set-AzureRmContext -SubscriptionName
"Microsoft Azure" Start-AzureRMVM -ResourceGroupName d-ehm-dev-na-01-rg
-name AUSEDEVADDCS01 Start-AzureRMVM -ResourceGroupName
d-ehm-dev-na-01-rg -name AUSEDEVJMPBX01 Start-AzureRMVM
-ResourceGroupName d-ehm-dev-na-01-rg -name AUSEDEVWNS1201 Here is the
STOP ##Login to Azure ARM ##This script gathers information about Azure
ARM REsources $azureAccountName ="youraccount@yourdns.onmicrosoft.com"
$azurePassword = ConvertTo-SecureString "xxxxx" -AsPlainText -Force
$psCred = New-Object
System.Management.Automation.PSCredential($azureAccountName,
$azurePassword) Add-AzureRmAccount -Credential $psCred ##Switch
Subscriptions and set subscriptions Set-AzureRmContext -SubscriptionName
"Microsoft Azure" Stop-AzureRMVM -ResourceGroupName d-ehm-dev-na-01-rg
-name AUSEDEVADDCS01 -force Stop-AzureRMVM -ResourceGroupName
d-ehm-dev-na-01-rg -name AUSEDEVJMPBX01 -force Stop-AzureRMVM
-ResourceGroupName d-ehm-dev-na-01-rg -name AUSEDEVWNS1201 -force