Stop-AzVpnGatewayPacketCapture
Stops Packet Capture Operation on a Vpn Gateway.
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
Stop-AzVpnGatewayPacketCapture
-ResourceGroupName <String>
-Name <String>
-SasUrl <String>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Stop-AzVpnGatewayPacketCapture
-InputObject <PSVpnGateway>
-SasUrl <String>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Stop-AzVpnGatewayPacketCapture
-ResourceId <String>
-SasUrl <String>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Stops Packet Capture Operation on a Vpn Gateway and will upload the result on given SasUrl of storage container.
Examples
Example 1
PS C:\> $rgname = "testRg"
$storeName = "teststorage"
$containerName = "packetcaptureresults"
$key = Get-AzStorageAccountKey -ResourceGroupName $rgname -Name $storeName
$context = New-AzStorageContext -StorageAccountName $storeName -StorageAccountKey $key[0].Value
New-AzStorageContainer -Name $containerName -Context $context
$container = Get-AzStorageContainer -Name $containerName -Context $context
$now=get-date
$sasurl = New-AzureStorageContainerSASToken -Name $containerName -Context $context -Permission "rwd" -StartTime $now.AddHours(-1) -ExpiryTime $now.AddDays(1) -FullUri
PS C:\> Stop-AzVpnGatewayPacketCapture -ResourceGroupName $rgname -Name "testgw" -SasUrl $sasurl
Code : Succeeded
EndTime : 10/1/2019 12:59:37 AM
StartTime : 10/1/2019 12:58:26 AM
ResultsText :
ResourceGroupName : testRg
Location : centraluseuap
ResourceGuid : 161c0fff-f3fd-4698-9ab3-8ca9470de975
Type :
Tag :
TagsTable :
Name : testgw
Etag :
Id :
Example 2
PS C:\> $rgname = "testRg"
$storeName = "teststorage"
$containerName = "packetcaptureresults"
$key = Get-AzStorageAccountKey -ResourceGroupName $rgname -Name $storeName
$context = New-AzStorageContext -StorageAccountName $storeName -StorageAccountKey $key[0].Value
$container = Get-AzStorageContainer -Name $containerName -Context $context
$now=get-date
$sasurl = New-AzureStorageContainerSASToken -Name $containerName -Context $context -Permission "rwd" -StartTime $now.AddHours(-1) -ExpiryTime $now.AddDays(1) -FullUri
$gw = Get-AzVpnGateway -ResourceGroupName $rgname -name "testGw"
PS C:\> Stop-AzVpnGatewayPacketCapture -InputObject $gw -SasUrl $sasurl
Code : Succeeded
EndTime : 10/1/2019 12:59:37 AM
StartTime : 10/1/2019 12:58:26 AM
ResultsText :
ResourceGroupName : testRg
Location : centraluseuap
ResourceGuid : 161c0fff-f3fd-4698-9ab3-8ca9470de975
Type :
Tag :
TagsTable :
Name : testgw
Etag :
Id :
Parameters
Run cmdlet in the background
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
| Type: | SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with Azure.
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The Vpn Gateway object where packet capture to be started.
| Type: | PSVpnGateway |
| Aliases: | VpnGateway |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The Vpn Gateway name where packet capture to be started.
| Type: | String |
| Aliases: | ResourceName, VpnGatewayName, GatewayName |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The resource group name.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The Azure resource ID of the VpnGateway where packet capture to be started.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
SAS URL packet capture on Vpn Gateway.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
| Type: | SwitchParameter |
| Aliases: | wi |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Inputs
Outputs
Microsoft.Azure.Commands.Network.Models.PSVpnGatewayPacketCaptureResult