![](/img/trans.png)
[英]Azure Runbooks - Missing PowerShell Cmdlets Or Not Executing Against a VM
[英]Add azure vm to Active Directory during deployment using powershell and azure runbooks
是否可以在部署期間使用 Azure Runbooks 和 Powershell 將 Azure VM 添加到 Active Directory 域?
我在 Azure 中有一個使用 PowerShell 的 Runbook。 PowerShell 調用模板來部署 VM,如下所示。 我更願意使用 PowerShell 而不是 ARM 模板來做到這一點,有沒有辦法做到這一點?
New-AzureRmResourceGroupDeployment -ResourceGroupName $resourcegroup `
-TemplateUri $vm_template_uri -TemplateParameterObject $ServerParameters
這對我很有效: How to join a VM to a domain by PowerShell in Azure
$DomainName = "your_domain_name"
$VMName = "your_VM_Name"
$credential = Get-Credential your_Domain_account
$ResourceGroupName = "your_RG_name"
Set-AzVMADDomainExtension -DomainName $DomainName -VMName $VMName -Credential $credential -ResourceGroupName $ResourceGroupName -JoinOption 0x00000001 -Restart -Verbose
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.