Set-AzNetworkWatcherConfigFlowLog

Hiermee configureert u stroomlogboekregistratie voor een doelresource.

Syntax

Set-AzNetworkWatcherConfigFlowLog
   -NetworkWatcher <PSNetworkWatcher>
   -TargetResourceId <String>
   -EnableFlowLog <Boolean>
   -StorageAccountId <String>
   [-EnableRetention <Boolean>]
   [-RetentionInDays <Int32>]
   [-FormatType <String>]
   [-FormatVersion <Int32>]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzNetworkWatcherConfigFlowLog
   -NetworkWatcher <PSNetworkWatcher>
   -TargetResourceId <String>
   -EnableFlowLog <Boolean>
   -StorageAccountId <String>
   [-EnableRetention <Boolean>]
   [-RetentionInDays <Int32>]
   [-FormatType <String>]
   [-FormatVersion <Int32>]
   [-AsJob]
   [-EnableTrafficAnalytics]
   -Workspace <IOperationalInsightWorkspace>
   [-TrafficAnalyticsInterval <Int32>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzNetworkWatcherConfigFlowLog
   -NetworkWatcher <PSNetworkWatcher>
   -TargetResourceId <String>
   -EnableFlowLog <Boolean>
   -StorageAccountId <String>
   [-EnableRetention <Boolean>]
   [-RetentionInDays <Int32>]
   [-FormatType <String>]
   [-FormatVersion <Int32>]
   [-AsJob]
   [-EnableTrafficAnalytics]
   -WorkspaceResourceId <String>
   -WorkspaceGUID <String>
   -WorkspaceLocation <String>
   [-TrafficAnalyticsInterval <Int32>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzNetworkWatcherConfigFlowLog
   -NetworkWatcherName <String>
   -ResourceGroupName <String>
   -TargetResourceId <String>
   -EnableFlowLog <Boolean>
   -StorageAccountId <String>
   [-EnableRetention <Boolean>]
   [-RetentionInDays <Int32>]
   [-FormatType <String>]
   [-FormatVersion <Int32>]
   [-AsJob]
   [-EnableTrafficAnalytics]
   -Workspace <IOperationalInsightWorkspace>
   [-TrafficAnalyticsInterval <Int32>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzNetworkWatcherConfigFlowLog
   -NetworkWatcherName <String>
   -ResourceGroupName <String>
   -TargetResourceId <String>
   -EnableFlowLog <Boolean>
   -StorageAccountId <String>
   [-EnableRetention <Boolean>]
   [-RetentionInDays <Int32>]
   [-FormatType <String>]
   [-FormatVersion <Int32>]
   [-AsJob]
   [-EnableTrafficAnalytics]
   -WorkspaceResourceId <String>
   -WorkspaceGUID <String>
   -WorkspaceLocation <String>
   [-TrafficAnalyticsInterval <Int32>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzNetworkWatcherConfigFlowLog
   -NetworkWatcherName <String>
   -ResourceGroupName <String>
   -TargetResourceId <String>
   -EnableFlowLog <Boolean>
   -StorageAccountId <String>
   [-EnableRetention <Boolean>]
   [-RetentionInDays <Int32>]
   [-FormatType <String>]
   [-FormatVersion <Int32>]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzNetworkWatcherConfigFlowLog
   -Location <String>
   -TargetResourceId <String>
   -EnableFlowLog <Boolean>
   -StorageAccountId <String>
   [-EnableRetention <Boolean>]
   [-RetentionInDays <Int32>]
   [-FormatType <String>]
   [-FormatVersion <Int32>]
   [-AsJob]
   [-EnableTrafficAnalytics]
   -Workspace <IOperationalInsightWorkspace>
   [-TrafficAnalyticsInterval <Int32>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzNetworkWatcherConfigFlowLog
   -Location <String>
   -TargetResourceId <String>
   -EnableFlowLog <Boolean>
   -StorageAccountId <String>
   [-EnableRetention <Boolean>]
   [-RetentionInDays <Int32>]
   [-FormatType <String>]
   [-FormatVersion <Int32>]
   [-AsJob]
   [-EnableTrafficAnalytics]
   -WorkspaceResourceId <String>
   -WorkspaceGUID <String>
   -WorkspaceLocation <String>
   [-TrafficAnalyticsInterval <Int32>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzNetworkWatcherConfigFlowLog
   -Location <String>
   -TargetResourceId <String>
   -EnableFlowLog <Boolean>
   -StorageAccountId <String>
   [-EnableRetention <Boolean>]
   [-RetentionInDays <Int32>]
   [-FormatType <String>]
   [-FormatVersion <Int32>]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

De set-AzNetworkWatcherConfigFlowLog configureert stroomlogboekregistratie voor een doelresource. Eigenschappen die moeten worden geconfigureerd, zijn onder andere: of stroomlogboekregistratie is ingeschakeld voor de opgegeven resource, het geconfigureerde opslagaccount voor het verzenden van logboeken, de indeling voor stroomlogboekregistratie en het bewaarbeleid voor de logboeken. Momenteel worden netwerkbeveiligingsgroepen ondersteund voor stroomlogboekregistratie.

Voorbeelden

Voorbeeld 1: Stroomlogboekregistratie configureren voor een opgegeven NSG

$NW = Get-AzNetworkWatcher -ResourceGroupName NetworkWatcherRg -Name NetworkWatcher_westcentralus
$nsg = Get-AzNetworkSecurityGroup -ResourceGroupName NSGRG -Name appNSG
$storageId = "/subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Storage/storageAccounts/contosostorageacct123"


Set-AzNetworkWatcherConfigFlowLog -NetworkWatcher $NW -TargetResourceId $nsg.Id -EnableFlowLog $true -StorageAccountId $storageID

TargetResourceId : /subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Network/networkSecurityGroups/appNSG
StorageId        : /subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Storage/storageAccounts/contosostorageacct123
Enabled          : True
RetentionPolicy  : {
                     "Days": 0,
                     "Enabled": false
                   }
Format           : {
                     "Type ": "Json",
                     "Version": 1
                   }

In dit voorbeeld configureren we de status van stroomlogboekregistratie voor een netwerkbeveiligingsgroep. In het antwoord zien we dat de opgegeven NSG stroomlogboekregistratie heeft ingeschakeld, de standaardindeling en geen bewaarbeleidsset.

Voorbeeld 2: Stroomlogboekregistratie configureren voor een opgegeven NSG en de versie van stroomlogboekregistratie instellen op 2.

$NW = Get-AzNetworkWatcher -ResourceGroupName NetworkWatcherRg -Name NetworkWatcher_westcentralus
$nsg = Get-AzNetworkSecurityGroup -ResourceGroupName NSGRG -Name appNSG
$storageId = "/subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Storage/storageAccounts/contosostorageacct123"


Set-AzNetworkWatcherConfigFlowLog -NetworkWatcher $NW -TargetResourceId $nsg.Id -EnableFlowLog $true -StorageAccountId $storageID -FormatVersion 2

TargetResourceId : /subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Network/networkSecurityGroups/appNSG
StorageId        : /subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Storage/storageAccounts/contosostorageacct123
Enabled          : True
RetentionPolicy  : {
                     "Days": 0,
                     "Enabled": false
                   }
Format           : {
                     "Type ": "Json",
                     "Version": 2
                   }

In dit voorbeeld configureren we stroomlogboekregistratie in een netwerkbeveiligingsgroep (NSG) met versie 2-logboeken die zijn opgegeven. In het antwoord zien we dat de opgegeven NSG stroomlogboekregistratie heeft ingeschakeld, dat de indeling is ingesteld en dat er geen bewaarbeleid is geconfigureerd. Als de regio geen versie ondersteunt die u hebt opgegeven, schrijft Network Watcher de standaard ondersteunde versie in de regio.

Voorbeeld 3: Stroomlogboekregistratie en Traffic Analytics configureren voor een opgegeven NSG

$NW = Get-AzNetworkWatcher -ResourceGroupName NetworkWatcherRg -Name NetworkWatcher_westcentralus
$nsg = Get-AzNetworkSecurityGroup -ResourceGroupName NSGRG -Name appNSG
$storageId = "/subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Storage/storageAccounts/contosostorageacct123"
$workspace = Get-AzOperationalInsightsWorkspace -Name WorkspaceName -ResourceGroupName WorkspaceRg


Set-AzNetworkWatcherConfigFlowLog -NetworkWatcher $NW -TargetResourceId $nsg.Id -EnableFlowLog $true -StorageAccountId $storageID -EnableTrafficAnalytics -Workspace $workspace -TrafficAnalyticsInterval 60

TargetResourceId : /subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Network/networkSecurityGroups/appNSG
StorageId        : /subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Storage/storageAccounts/contosostorageacct123
Enabled          : True
RetentionPolicy  : {
                     "Days": 0,
                     "Enabled": false
                   }
Format           : {
                     "Type ": "Json",
                     "Version": 1
                   }
FlowAnalyticsConfiguration : {
            "networkWatcherFlowAnalyticsConfiguration": {
              "enabled": true,
              "workspaceId": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
              "workspaceRegion": "WorkspaceLocation",
              "workspaceResourceId": "/subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourcegroups/WorkspaceRg/providers/microsoft.operationalinsights/workspaces/WorkspaceName",
			  "TrafficAnalyticsInterval": 60
            }
          }

In dit voorbeeld configureren we de status van stroomlogboekregistratie en Traffic Analytics voor een netwerkbeveiligingsgroep. In het antwoord zien we dat de opgegeven NSG stroomlogboekregistratie heeft ingeschakeld en Traffic Analytics is ingeschakeld, standaardindeling en geen bewaarbeleid is ingesteld.

Voorbeeld 4: Traffic Analytics uitschakelen voor een opgegeven NSG met stroomlogboekregistratie en Traffic Analytics geconfigureerd

$NW = Get-AzNetworkWatcher -ResourceGroupName NetworkWatcherRg -Name NetworkWatcher_westcentralus
$nsg = Get-AzNetworkSecurityGroup -ResourceGroupName NSGRG -Name appNSG
$storageId = "/subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Storage/storageAccounts/contosostorageacct123"
$workspace = Get-AzOperationalInsightsWorkspace -Name WorkspaceName -ResourceGroupName WorkspaceRg
Set-AzNetworkWatcherConfigFlowLog -NetworkWatcher $NW -TargetResourceId $nsg.Id -EnableFlowLog $true -StorageAccountId $storageID -EnableTrafficAnalytics -Workspace $workspace -TrafficAnalyticsInterval 60


Set-AzNetworkWatcherConfigFlowLog -NetworkWatcher $NW -TargetResourceId $nsg.Id -EnableFlowLog $true -StorageAccountId $storageID -EnableTrafficAnalytics:$false -Workspace $workspace

TargetResourceId : /subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Network/networkSecurityGroups/appNSG
StorageId        : /subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Storage/storageAccounts/contosostorageacct123
Enabled          : True
RetentionPolicy  : {
                     "Days": 0,
                     "Enabled": false
                   }
Format           : {
                     "Type ": "Json",
                     "Version": 1
                   }
FlowAnalyticsConfiguration : {
            "networkWatcherFlowAnalyticsConfiguration": {
              "enabled": false,
              "workspaceId": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
              "workspaceRegion": "WorkspaceLocation",
              "workspaceResourceId": "/subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourcegroups/WorkspaceRg/providers/microsoft.operationalinsights/workspaces/WorkspaceName",
	      "TrafficAnalyticsInterval": 60
            }
          }

In dit voorbeeld schakelen we Traffic Analytics uit voor een netwerkbeveiligingsgroep waarvoor stroomlogboekregistratie is ingesteld en Traffic Analytics eerder is geconfigureerd. In het antwoord zien we dat de opgegeven NSG stroomlogboekregistratie heeft ingeschakeld, maar Traffic Analytics is uitgeschakeld.

Parameters

-AsJob

Cmdlet op de achtergrond uitvoeren

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

-Confirm

Hiermee wordt u gevraagd om bevestiging voordat u de cmdlet uitvoert.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

De referenties, het account, de tenant en het abonnement die worden gebruikt voor communicatie met Azure.

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

-EnableFlowLog

Vlag om stroomlogboekregistratie in of uit te schakelen.

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

-EnableRetention

Vlag om retentie in of uit te schakelen.

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

-EnableTrafficAnalytics

Vlag om retentie in of uit te schakelen.

Type:SwitchParameter
Aliases:EnableTA
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-FormatType

Type stroomlogboekindeling.

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

-FormatVersion

Versie van stroomlogboekindeling.

Type:Nullable<T>[Int32]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Location

Locatie van de network watcher.

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

-NetworkWatcher

De network watcher-resource.

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

-NetworkWatcherName

De naam van network watcher.

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

-ResourceGroupName

De naam van de network watcher-resourcegroep.

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

-RetentionInDays

Aantal dagen voor het bewaren van stroomlogboekrecords.

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

-StorageAccountId

Id van het opslagaccount dat wordt gebruikt voor het opslaan van het stroomlogboek.

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

-TargetResourceId

De doelresource-id.

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

-TrafficAnalyticsInterval

Hiermee wordt het interval (in minuten) opgevraagd of ingesteld, waarmee wordt bepaald hoe vaak de TA-service stroomanalyses moet uitvoeren. Ondersteunde waarden zijn 10 en 60 minuten.

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

-WhatIf

Hiermee wordt weergegeven wat er zou gebeuren als u de cmdlet uitvoert. De cmdlet wordt niet uitgevoerd.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Workspace

Het WS-object dat wordt gebruikt voor het opslaan van de verkeersanalysegegevens.

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

-WorkspaceGUID

GUID van de WS die wordt gebruikt voor het opslaan van de verkeersanalysegegevens.

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

-WorkspaceLocation

Azure-regio van de WS die wordt gebruikt om de verkeersanalysegegevens op te slaan.

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

-WorkspaceResourceId

Abonnement op de WS die wordt gebruikt om de verkeersanalysegegevens op te slaan.

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

Invoerwaarden

PSNetworkWatcher

String

Boolean

Int32

Nullable<T>[[System.Int32, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]

IOperationalInsightWorkspace

Uitvoerwaarden

PSFlowLog

Notities

Trefwoorden: azurerm, arm, resource, beheer, manager, netwerk, netwerken, watcher, stroom, logboeken, stroomlogboeken, logboekregistratie