Azure powershell - 如何从 VM 获取 FQDN?
Azure powershell - how to get FQDN from a VM?
我正在自动部署多个 Azure VM,我想将 WinRM 加入到每个 VM 中以完成部署。如何从创建它的脚本中找到 VM 的 FQDN?
我在找:
$psVirtualMachine = Add-AzureRmVMNetworkInterface -VM $psVirtualMachine -Id $Nic.Id
$CreateNewVM = New-AzureRMVM -ResourceGroupName $ResourceGroupName -Location $GeoLocation -VM $psVirtualMachine
Enter-PSSession -ConnectionUri https://<-- $CreateNewVM.FQDN -->:5986 -Credential $Cred -SessionOption (New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck) -Authentication Negotiate
How do I find the FQDN of the VM from the script that creates it?
默认情况下,Azure不会为Azure VM创建FQDN,我们可以使用powershell设置public IP地址设置来为Azure VM设置FQDN。
我们可以使用此命令获取 FQDN:
$FQDN = (Get-AzureRmPublicIpAddress -Name 'name of public IP' -ResourceGroupName jasonvm).DnsSettings.Fqdn
像这样:
PS C:\Users> (Get-AzureRmPublicIpAddress -Name 'jasonvm-ip' -ResourceGroupName jasonvm).DnsSettings.Fqdn
jasontest321.japaneast.cloudapp.azure.com
要为 Azure VM 设置 FQDN,我们可以使用这个 powershell
New-AzureRmPublicIpAddress -Name -ResourceGroupName -Location -DomainNameLabel
我正在自动部署多个 Azure VM,我想将 WinRM 加入到每个 VM 中以完成部署。如何从创建它的脚本中找到 VM 的 FQDN?
我在找:
$psVirtualMachine = Add-AzureRmVMNetworkInterface -VM $psVirtualMachine -Id $Nic.Id
$CreateNewVM = New-AzureRMVM -ResourceGroupName $ResourceGroupName -Location $GeoLocation -VM $psVirtualMachine
Enter-PSSession -ConnectionUri https://<-- $CreateNewVM.FQDN -->:5986 -Credential $Cred -SessionOption (New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck) -Authentication Negotiate
How do I find the FQDN of the VM from the script that creates it?
默认情况下,Azure不会为Azure VM创建FQDN,我们可以使用powershell设置public IP地址设置来为Azure VM设置FQDN。
我们可以使用此命令获取 FQDN:
$FQDN = (Get-AzureRmPublicIpAddress -Name 'name of public IP' -ResourceGroupName jasonvm).DnsSettings.Fqdn
像这样:
PS C:\Users> (Get-AzureRmPublicIpAddress -Name 'jasonvm-ip' -ResourceGroupName jasonvm).DnsSettings.Fqdn
jasontest321.japaneast.cloudapp.azure.com
要为 Azure VM 设置 FQDN,我们可以使用这个 powershell
New-AzureRmPublicIpAddress -Name -ResourceGroupName -Location -DomainNameLabel