Get-​Azure​Rm​Network​Watcher​Security​Group​View

View the configured and effective network security group rules applied on a VM.

Syntax

Get-AzureRmNetworkWatcherSecurityGroupView
   -NetworkWatcher <PSNetworkWatcher>
   -TargetVirtualMachineId <String>
   [<CommonParameters>]
Get-AzureRmNetworkWatcherSecurityGroupView
   -NetworkWatcherName <String>
   -ResourceGroupName <String>
   -TargetVirtualMachineId <String>
   [<CommonParameters>]

Description

The Get-AzureRmNetworkWatcherSecurityGroupView enables you to view the configured and effective network security group rules applied on a VM.

Examples

--- Example 1: Make a Security Group View call on a VM ---

$nw = Get-AzurermResource | Where {$_.ResourceType -eq "Microsoft.Network/networkWatchers" -and $_.Location -eq "WestCentralUS" } 
$networkWatcher = Get-AzureRmNetworkWatcher -Name $nw.Name -ResourceGroupName $nw.ResourceGroupName 
$VM = Get-AzurermVM -ResourceGroupName ContosoResourceGroup -Name VM0 
Get-AzureRmNetworkWatcherSecurityGroupView -NetworkWatcher $networkWatcher -TargetVirtualMachineId $VM.Id

In the above example, we first get the regional Network Watcher, then a VM in the region. Then we make a Security Group View call on the specified VM.

Required Parameters

-NetworkWatcher

The network watcher resource.

Type:PSNetworkWatcher
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-NetworkWatcherName

The name of network watcher.

Type:String
Aliases:Name
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-ResourceGroupName

The name of the network watcher resource group.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-TargetVirtualMachineId

The target VM Id

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Inputs

Microsoft.Azure.Commands.Network.Models.PSNetworkWatcher

System.String

Outputs

Microsoft.Azure.Commands.Network.Models.PSViewNsgRules

Notes

Keywords: azure, azurerm, arm, resource, management, manager, network, networking, network watcher, flow, ip