2015-03-13 32 views

回答

1

我建議你幾個東西 -

一個。大多數進入 - 轉到ASSET選項卡並添加適當的Windows PowerShell憑證(只需使用用戶名和密碼,就可以使用它登錄到Azure門戶)。

b。在runbook中添加您的代碼。假設您的PowerShell自動化憑證名稱是StartVM,並且您的訂閱名稱是xxx。在這種情況下,工作流將是─

workflow StartVM 
{ 
$Cred = Get-AutomationPSCredential -Name 
StartVM' Add-AzureAccount -Credential $Cred 
Select-AzureSubscription -SubscriptionName 「xxx」 
inlineScript 
{ 
Start-AzureVM -Name TestServer -ServiceName CS12345 
} 
} 

℃。在此之後,您可以根據需要安排您的Runbook。

希望這人會幫助你 -

http://azure.microsoft.com/blog/2014/11/25/introducing-the-azure-automation-script-converter/http://azure.microsoft.com/en-us/documentation/articles/automation-create-runbook-from-samples/

感謝。