你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Get-AzNetworkWatcherTroubleshootingResult

获取上次运行的或当前正在运行的故障排除操作的故障排除结果。

语法

Get-AzNetworkWatcherTroubleshootingResult
   -NetworkWatcher <PSNetworkWatcher>
   -TargetResourceId <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzNetworkWatcherTroubleshootingResult
   -NetworkWatcherName <String>
   -ResourceGroupName <String>
   -TargetResourceId <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzNetworkWatcherTroubleshootingResult
   -Location <String>
   -TargetResourceId <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

说明

Get-AzNetworkWatcherTroubleshootingResult cmdlet 从以前运行或当前运行的 Start-AzNetworkWatcherResourceTroubleshooting 操作获取故障排除结果。 如果故障排除操作当前正在进行中,则此操作可能需要几分钟才能完成。 目前支持虚拟网络网关和连接。

示例

示例 1:开始对虚拟网络网关进行故障排除并检索结果

$nw = Get-AzResource | Where-Object {$_.ResourceType -eq "Microsoft.Network/networkWatchers" -and $_.Location -eq "WestCentralUS" } 
$networkWatcher = Get-AzNetworkWatcher -Name $nw.Name -ResourceGroupName $nw.ResourceGroupName 

$target = '/subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{vnetGatewayName}'
$storageId = '/subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{storageAccountName}'
$storagePath = 'https://{storageAccountName}.blob.core.windows.net/troubleshoot'

Start-AzNetworkWatcherResourceTroubleshooting -NetworkWatcher $networkWatcher -TargetResourceId $target -StorageId $storageId -StoragePath $storagePath

Get-AzNetworkWatcherTroubleshootingResult -NetworkWatcher $NW -TargetResourceId $target

上面的示例开始对虚拟网络网关进行故障排除。 此操作可能需要几分钟才能完成。 故障排除开始后,对资源发出 Get-AzNetworkWatcherTroubleshootingResult 调用以检索此调用的结果。

参数

-DefaultProfile

用于与 Azure 通信的凭据、帐户、租户和订阅。

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Location

网络观察程序的位置。

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NetworkWatcher

网络观察程序资源。

Type:PSNetworkWatcher
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-NetworkWatcherName

网络观察程序的名称。

Type:String
Aliases:Name
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

网络观察程序资源组的名称。

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-TargetResourceId

目标资源 ID。

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

输入

PSNetworkWatcher

String

输出

PSTroubleshootingResult

备注

关键字:azure, azurerm, arm, 资源, 管理, 管理器, 网络, 网络, 网络观察程序, 故障排除, VPN, 连接