使用AzureRM 6.13识别DTL VM的RDP端口号 [英] Identify a DTL VM's RDP Port Number with AzureRM 6.13

查看:77
本文介绍了使用AzureRM 6.13识别DTL VM的RDP端口号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


使用
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.FrontendPort

Hope this helps!


这篇关于使用AzureRM 6.13识别DTL VM的RDP端口号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆