使用AzureRM 6.13识别DTL VM的RDP端口号 [英] Identify a DTL VM's RDP Port Number with AzureRM 6.13
问题描述
您好,
使用
a previous thread 我一直在使用以下ODataQuery来获取VM的frontendPort编号。
$ vm = Get-AzureRmResource -ResourceId $ LabVmId -ODataQuery'$ expand = Properties($ expand = NetworkInterface)'
$ vm.Properties.networkInterface.sharedPublicIpAddressConfiguration .inboundNatRules.frontendPort
第一行似乎不适用于6.13版本的AzureRm:
$ vm = Get-AzureRmResource -Name $ v.Name -ODataQuery'$ expand = Properties($ expand = NetworkInterface) '
Get-AzureRmResource:$ filter'无效' $ expand =在查询字符串中指定的属性($ expand = NetworkInterface)。
在行:1 char:7
+ $ vm = Get-AzureRmResource -Name $ v.Name -ODataQuery'$ expand = Properti ...
$
+ ;     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~
+ CategoryInfo :CloseError:(:) [Get-AzureRmResource],CloudException
+ FullyQualifiedErrorId:Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.GetAzureResourceCmdlet
是否有更新的方式来获取此信息使用AzureRm 6.13的信息?
谢谢,
Michael
嗨迈克尔,
感谢您的光临!
有一种更简单的方法使用AzureRM 6.13识别DTL VM的RDP端口号
您可以使用以下脚本:
//这将为您提供资源组中存在的所有入站NAT规则的列表
Get-AzureRmLoadBalancerInboundNatRuleConfig -LoadBalancer(Get-AzureRmLoadBalancer -ResourceGroupName< Resource_Group_of_VM>)| fl
现在您可以选择所需的规则并运行以下命令:
NatRule = Get-AzureRmLoadBalancerInboundNatRuleConfig -name< Rule_Name> -LoadBalancer(Get-AzureRmLoadBalancer -ResourceGroupName< Resource_Group_of_VM))
NatRule.FrontendPort希望这会有所帮助!
Hello,
Using information from a previous thread I have been using the following ODataQuery to get a VM's frontendPort number.
$vm = Get-AzureRmResource -ResourceId $LabVmId -ODataQuery '$expand=Properties($expand=NetworkInterface)' $vm.Properties.networkInterface.sharedPublicIpAddressConfiguration.inboundNatRules.frontendPort
The first line does not seem to work in the 6.13 version of AzureRm:
$vm = Get-AzureRmResource -Name $v.Name -ODataQuery '$expand=Properties($expand=NetworkInterface)'
Get-AzureRmResource : Invalid $filter '$expand=Properties($expand=NetworkInterface)' specified in the query string.
At line:1 char:7
+ $vm = Get-AzureRmResource -Name $v.Name -ODataQuery '$expand=Properti ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-AzureRmResource], CloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.GetAzureResourceCmdlet
Is there an updated way to get this information using AzureRm 6.13?
Thanks,
Michael
Hi Michael,
Thanks for reaching out!
There is a simpler way of identifying a DTL VM's RDP Port Number with AzureRM 6.13
You can use the below scripts:
//This will provide you with a list of all the Inbound NAT rules present in your resource group
Get-AzureRmLoadBalancerInboundNatRuleConfig -LoadBalancer (Get-AzureRmLoadBalancer -ResourceGroupName <Resource_Group_of_VM>) | fl
Now you can choose the required rule and run the below command:
NatRule= Get-AzureRmLoadBalancerInboundNatRuleConfig -name <Rule_Name> -LoadBalancer (Get-AzureRmLoadBalancer -ResourceGroupName <Resource_Group_of_VM))
NatRule.FrontendPortHope this helps!
这篇关于使用AzureRM 6.13识别DTL VM的RDP端口号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!