New-AzBastion
Cria um recurso bastião.
Sintaxe
New-AzBastion
-ResourceGroupName <String>
-Name <String>
-PublicIpAddress <PSPublicIpAddress>
-VirtualNetwork <PSVirtualNetwork>
[-Sku <String>]
[-ScaleUnit <Int32>]
[-EnableKerberos <Boolean>]
[-DisableCopyPaste <Boolean>]
[-EnableTunneling <Boolean>]
[-EnableIpConnect <Boolean>]
[-EnableShareableLink <Boolean>]
[-EnableSessionRecording <Boolean>]
[-AsJob]
[-Tag <Hashtable>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzBastion
-ResourceGroupName <String>
-Name <String>
-PublicIpAddress <PSPublicIpAddress>
-VirtualNetworkRgName <String>
-VirtualNetworkName <String>
[-Sku <String>]
[-ScaleUnit <Int32>]
[-EnableKerberos <Boolean>]
[-DisableCopyPaste <Boolean>]
[-EnableTunneling <Boolean>]
[-EnableIpConnect <Boolean>]
[-EnableShareableLink <Boolean>]
[-EnableSessionRecording <Boolean>]
[-AsJob]
[-Tag <Hashtable>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzBastion
-ResourceGroupName <String>
-Name <String>
-PublicIpAddress <PSPublicIpAddress>
-VirtualNetworkId <String>
[-Sku <String>]
[-ScaleUnit <Int32>]
[-EnableKerberos <Boolean>]
[-DisableCopyPaste <Boolean>]
[-EnableTunneling <Boolean>]
[-EnableIpConnect <Boolean>]
[-EnableShareableLink <Boolean>]
[-EnableSessionRecording <Boolean>]
[-AsJob]
[-Tag <Hashtable>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzBastion
-ResourceGroupName <String>
-Name <String>
-PublicIpAddressId <String>
-VirtualNetwork <PSVirtualNetwork>
[-Sku <String>]
[-ScaleUnit <Int32>]
[-EnableKerberos <Boolean>]
[-DisableCopyPaste <Boolean>]
[-EnableTunneling <Boolean>]
[-EnableIpConnect <Boolean>]
[-EnableShareableLink <Boolean>]
[-EnableSessionRecording <Boolean>]
[-AsJob]
[-Tag <Hashtable>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzBastion
-ResourceGroupName <String>
-Name <String>
-PublicIpAddressId <String>
-VirtualNetworkRgName <String>
-VirtualNetworkName <String>
[-Sku <String>]
[-ScaleUnit <Int32>]
[-EnableKerberos <Boolean>]
[-DisableCopyPaste <Boolean>]
[-EnableTunneling <Boolean>]
[-EnableIpConnect <Boolean>]
[-EnableShareableLink <Boolean>]
[-EnableSessionRecording <Boolean>]
[-AsJob]
[-Tag <Hashtable>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzBastion
-ResourceGroupName <String>
-Name <String>
-PublicIpAddressId <String>
-VirtualNetworkId <String>
[-Sku <String>]
[-ScaleUnit <Int32>]
[-EnableKerberos <Boolean>]
[-DisableCopyPaste <Boolean>]
[-EnableTunneling <Boolean>]
[-EnableIpConnect <Boolean>]
[-EnableShareableLink <Boolean>]
[-EnableSessionRecording <Boolean>]
[-AsJob]
[-Tag <Hashtable>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzBastion
-ResourceGroupName <String>
-Name <String>
-PublicIpAddressRgName <String>
-PublicIpAddressName <String>
-VirtualNetwork <PSVirtualNetwork>
[-Sku <String>]
[-ScaleUnit <Int32>]
[-EnableKerberos <Boolean>]
[-DisableCopyPaste <Boolean>]
[-EnableTunneling <Boolean>]
[-EnableIpConnect <Boolean>]
[-EnableShareableLink <Boolean>]
[-EnableSessionRecording <Boolean>]
[-AsJob]
[-Tag <Hashtable>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzBastion
-ResourceGroupName <String>
-Name <String>
-PublicIpAddressRgName <String>
-PublicIpAddressName <String>
-VirtualNetworkRgName <String>
-VirtualNetworkName <String>
[-Sku <String>]
[-ScaleUnit <Int32>]
[-EnableKerberos <Boolean>]
[-DisableCopyPaste <Boolean>]
[-EnableTunneling <Boolean>]
[-EnableIpConnect <Boolean>]
[-EnableShareableLink <Boolean>]
[-EnableSessionRecording <Boolean>]
[-AsJob]
[-Tag <Hashtable>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzBastion
-ResourceGroupName <String>
-Name <String>
-PublicIpAddressRgName <String>
-PublicIpAddressName <String>
-VirtualNetworkId <String>
[-Sku <String>]
[-ScaleUnit <Int32>]
[-EnableKerberos <Boolean>]
[-DisableCopyPaste <Boolean>]
[-EnableTunneling <Boolean>]
[-EnableIpConnect <Boolean>]
[-EnableShareableLink <Boolean>]
[-EnableSessionRecording <Boolean>]
[-AsJob]
[-Tag <Hashtable>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Cria um recurso bastião. Isso precisará de um endereço IP público e uma rede virtual. Deve haver uma sub-rede com o nome AzureBastionSubnet neste VirtualNetwork.O endereço IP púbico deve ser criado com Sku Standard.
Exemplos
Exemplo 1
$subnetName = "AzureBastionSubnet"
$subnet = New-AzVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix 10.0.0.0/24
$vnet = New-AzVirtualNetwork -Name "TestVnet" -ResourceGroupName "BastionPowershellTest" -Location "westeurope" -AddressPrefix 10.0.0.0/16 -Subnet $subnet
$publicip = New-AzPublicIpAddress -ResourceGroupName "BastionPowershellTest" -Name "Test-Ip" -location "westeurope" -AllocationMethod Dynamic -Sku Standard
$bastion = New-AzBastion -ResourceGroupName "BastionPowershellTest" -Name "test-Bastion2" -PublicIpAddress $publicip -VirtualNetwork $vnet
IpConfigurations : {IpConf}
DnsName : bst-a9ca868f-ddab-4a50-9f45-a443ea8a0187.bastion.azure.com
ProvisioningState : Succeeded
IpConfigurationsText : [
{
"Subnet": {
"Id": "/subscriptions/359a08a9-ff1b-463c-92d7-6df8d946f25c/resourceGroups/BastionPowershellTest/providers/Microsoft.Network/virtualNetworks/TestVnet/subnets/AzureBastionSubnet"
},
"PublicIpAddress": {
"Id": "/subscriptions/359a08a9-ff1b-463c-92d7-6df8d946f25c/resourceGroups/BastionPowershellTest/providers/Microsoft.Network/publicIPAddresses/Test-Ip"
},
"ProvisioningState": "Succeeded",
"PrivateIpAllocationMethod": "Dynamic",
"Name": "IpConf",
"Etag": "W/\"ed810ccd-b3f6-4e22-891e-b0ed0a26d6dd\"",
"Id": "/subscriptions/359a08a9-ff1b-463c-92d7-6df8d946f25c/resourceGroups/BastionPowershellTest/providers/Microsoft.Network/bastionHosts/test-Bastion2/bastionHostIpConfigurations/IpConf"
}
]
ResourceGroupName : BastionPowershellTest
Location : westeurope
ResourceGuid :
Type : Microsoft.Network/bastionHosts
Tag :
TagsTable :
Name : test-Bastion2
Etag : W/"ed810ccd-b3f6-4e22-891e-b0ed0a26d6dd"
Id : /subscriptions/359a08a9-ff1b-463c-92d7-6df8d946f25c/resourceGroups/BastionPowershellTest/providers/Microsoft.Network/bastionHosts/test-Bastion2
Sku : {
"Name": "Basic"
}
Scale Units : 2
Este exemplo cria um bastião anexado à rede virtual "vnet" no mesmo grupo de recursos que o bastião. Deve haver uma sub-rede com o nome AzureBastionSubnet nesta vnet. O endereço IP deve ser criado com Sku Standard.
Exemplo 2
$vnet = Get-AzVirtualNetwork -ResourceGroupName "BastionPowershellTest" -Name "testVnet2"
Add-AzVirtualNetworkSubnetConfig -Name "AzureBastionSubnet" -VirtualNetwork $vnet -AddressPrefix "10.0.0.0/24"
$vnet| Set-AzVirtualNetwork
New-AzBastion -ResourceGroupName "BastionPowershellTest" -Name "testBastion2" -PublicIpAddressRgName "BastionPowershellTest" -PublicIpAddressName "testIp2" -VirtualNetworkRgName "BastionPowershellTest" -VirtualNetworkName "testVnet2"
IpConfigurations : {IpConf}
DnsName : bst-53757658-c4fd-4908-b1a7-0849e555d489.bastion.azure.com
ProvisioningState : Succeeded
IpConfigurationsText : [
{
"Name": "IpConf",
"Etag": "W/\"7460e5f6-ad41-438b-a595-a63346ed8f16\"",
"Id": "/subscriptions/359a08a9-ff1b-463c-92d7-6df8d946f25c/resourceGroups/BastionPowershellTest/providers/Microsoft.Network/bastionHosts/testBastion2/bastionHostIpConfigurations/IpConf",
"Subnet": {
"Id": "/subscriptions/359a08a9-ff1b-463c-92d7-6df8d946f25c/resourceGroups/BastionPowershellTest/providers/Microsoft.Network/virtualNetworks/testVnet2/subnets/AzureBastionSubnet"
},
"PublicIpAddress": {
"Id": "/subscriptions/359a08a9-ff1b-463c-92d7-6df8d946f25c/resourceGroups/BastionPowershellTest/providers/Microsoft.Network/publicIPAddresses/testIp2"
},
"ProvisioningState": "Succeeded",
"PrivateIpAllocationMethod": "Dynamic"
}
]
ResourceGroupName : BastionPowershellTest
Location : westeurope
ResourceGuid :
Type : Microsoft.Network/bastionHosts
Tag :
TagsTable :
Name : testBastion2
Etag : W/"7460e5f6-ad41-438b-a595-a63346ed8f16"
Id : /subscriptions/359a08a9-ff1b-463c-92d7-6df8d946f25c/resourceGroups/BastionPowershellTest/providers/Microsoft.Network/bastionHosts/testBastion2
Sku : {
"Name": "Basic"
}
Scale Units : 2
Exemplo 3
$vnet = Get-AzVirtualNetwork -ResourceGroupName "BastionPowershellTest" -Name "testVnet2"
Add-AzVirtualNetworkSubnetConfig -Name "AzureBastionSubnet" -VirtualNetwork $vnet -AddressPrefix "10.0.0.0/24"
$vnet| Set-AzVirtualNetwork
New-AzBastion -ResourceGroupName "BastionPowershellTest" -Name "testBastion2" -PublicIpAddressRgName "BastionPowershellTest" -PublicIpAddressName "testIp2" -VirtualNetworkRgName "BastionPowershellTest" -VirtualNetworkName "testVnet2" -Sku "Standard" -ScaleUnit 3
IpConfigurations : {IpConf}
DnsName : bst-53757658-c4fd-4908-b1a7-0849e555d489.bastion.azure.com
ProvisioningState : Succeeded
IpConfigurationsText : [
{
"Name": "IpConf",
"Etag": "W/\"7460e5f6-ad41-438b-a595-a63346ed8f16\"",
"Id": "/subscriptions/359a08a9-ff1b-463c-92d7-6df8d946f25c/resourceGroups/BastionPowershellTest/providers/Microsoft.Network/bastionHosts/testBastion2/bastionHostIpConfigurations/IpConf",
"Subnet": {
"Id": "/subscriptions/359a08a9-ff1b-463c-92d7-6df8d946f25c/resourceGroups/BastionPowershellTest/providers/Microsoft.Network/virtualNetworks/testVnet2/subnets/AzureBastionSubnet"
},
"PublicIpAddress": {
"Id": "/subscriptions/359a08a9-ff1b-463c-92d7-6df8d946f25c/resourceGroups/BastionPowershellTest/providers/Microsoft.Network/publicIPAddresses/testIp2"
},
"ProvisioningState": "Succeeded",
"PrivateIpAllocationMethod": "Dynamic"
}
]
ResourceGroupName : BastionPowershellTest
Location : westeurope
ResourceGuid :
Type : Microsoft.Network/bastionHosts
Tag :
TagsTable :
Name : testBastion2
Etag : W/"7460e5f6-ad41-438b-a595-a63346ed8f16"
Id : /subscriptions/359a08a9-ff1b-463c-92d7-6df8d946f25c/resourceGroups/BastionPowershellTest/providers/Microsoft.Network/bastionHosts/testBastion2
Sku : {
"Name": "Standard"
}
Scale Units : 3
Este exemplo cria um recurso BastionHost com Sku padrão e 3 unidades de escala.
Parâmetros
-AsJob
Executar cmdlet em segundo plano
Tipo: | SwitchParameter |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-Confirm
Solicita a sua confirmação antes de executar o cmdlet.
Tipo: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-DefaultProfile
As credenciais, a conta, o locatário e a assinatura usados para comunicação com o Azure.
Tipo: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-DisableCopyPaste
Copiar e Colar
Tipo: | Nullable<T>[Boolean] |
Position: | Named |
Default value: | False |
Necessário: | False |
Aceitar entrada de pipeline: | True |
Aceitar carateres universais: | False |
-EnableIpConnect
Conexão IP
Tipo: | Nullable<T>[Boolean] |
Position: | Named |
Default value: | False |
Necessário: | False |
Aceitar entrada de pipeline: | True |
Aceitar carateres universais: | False |
-EnableKerberos
Kerberos
Tipo: | Nullable<T>[Boolean] |
Position: | Named |
Default value: | False |
Necessário: | False |
Aceitar entrada de pipeline: | True |
Aceitar carateres universais: | False |
-EnableSessionRecording
Gravação da Sessão
Tipo: | Nullable<T>[Boolean] |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | True |
Aceitar carateres universais: | False |
-EnableShareableLink
Ligação Partilhável
Tipo: | Nullable<T>[Boolean] |
Position: | Named |
Default value: | False |
Necessário: | False |
Aceitar entrada de pipeline: | True |
Aceitar carateres universais: | False |
-EnableTunneling
Cliente nativo
Tipo: | Nullable<T>[Boolean] |
Position: | Named |
Default value: | False |
Necessário: | False |
Aceitar entrada de pipeline: | True |
Aceitar carateres universais: | False |
-Name
O nome do recurso bastião.
Tipo: | String |
Aliases: | ResourceName, BastionName |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-PublicIpAddress
O objeto de endereço IP público para bastião.
Tipo: | PSPublicIpAddress |
Aliases: | PublicIpAddressObject |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-PublicIpAddressId
O endereço IP público ID do recurso do Azure para bastião.
Tipo: | String |
Aliases: | PublicIpAddressResourceId |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-PublicIpAddressName
O nome do recurso de endereço IP público para bastião.
Tipo: | String |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-PublicIpAddressRgName
O nome do grupo de recursos de endereço IP público para bastião.
Tipo: | String |
Aliases: | PublicIpAddressResourceGroupName |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-ResourceGroupName
O nome do grupo de recursos onde você precisa criar bastião.
Tipo: | String |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-ScaleUnit
As unidades de escala para BastionHost
Tipo: | Nullable<T>[Int32] |
Position: | Named |
Default value: | 2 |
Necessário: | False |
Aceitar entrada de pipeline: | True |
Aceitar carateres universais: | False |
-Sku
O Bastion Sku Tier
Tipo: | String |
Valores aceites: | Basic, Standard, Premium |
Position: | Named |
Default value: | Basic |
Necessário: | False |
Aceitar entrada de pipeline: | True |
Aceitar carateres universais: | False |
-Tag
Uma hashtable que representa marcas de recursos.
Tipo: | Hashtable |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-VirtualNetwork
O objeto de rede virtual para bastião.
Tipo: | PSVirtualNetwork |
Aliases: | VirtualNetworkObject |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-VirtualNetworkId
A rede virtual Azure resource Id for bastion.
Tipo: | String |
Aliases: | VirtualNetworkResourceId |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-VirtualNetworkName
O nome do recurso de rede virtual para bastião.
Tipo: | String |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-VirtualNetworkRgName
O nome do grupo de recursos de rede virtual para bastião.
Tipo: | String |
Aliases: | VirtualNetworkResourceGroupName |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-WhatIf
Apresenta o que aconteceria mediante a execução do cmdlet. O cmdlet não é executado.
Tipo: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
Entradas
Nullable<T>[[System.Int32, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
Nullable<T>[[System.Boolean, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]