Bagikan melalui


New-AzBastion

Membuat sumber daya bastion.

Sintaks

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>]

Deskripsi

Membuat sumber daya bastion. Ini akan memerlukan Alamat IP Publik dan VirtualNetwork. Harus ada subnet dengan nama AzureBastionSubnet di VirtualNetwork ini.Alamat Ip Pubik harus dibuat dengan Standar Sku.

Contoh

Contoh 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

Contoh ini membuat bastion yang dilampirkan ke jaringan virtual "vnet" dalam grup sumber daya yang sama dengan bastion. Harus ada subnet dengan nama AzureBastionSubnet di vnet ini. Alamat Ip harus dibuat dengan Standar Sku.

Contoh 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

Contoh 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

Contoh ini membuat sumber daya BastionHost dengan Sku Standar dan 3 Unit Skala.

Parameter

-AsJob

Jalankan cmdlet di latar belakang

Jenis:SwitchParameter
Position:Named
Nilai default:None
Diperlukan:False
Terima input alur:False
Terima karakter wildcard:False

-Confirm

Meminta Anda mengonfirmasi sebelum menjalankan cmdlet.

Jenis:SwitchParameter
Alias:cf
Position:Named
Nilai default:None
Diperlukan:False
Terima input alur:False
Terima karakter wildcard:False

-DefaultProfile

Kredensial, akun, penyewa, dan langganan yang digunakan untuk komunikasi dengan Azure.

Jenis:IAzureContextContainer
Alias:AzContext, AzureRmContext, AzureCredential
Position:Named
Nilai default:None
Diperlukan:False
Terima input alur:False
Terima karakter wildcard:False

-DisableCopyPaste

Salin dan Tempel

Jenis:Nullable<T>[Boolean]
Position:Named
Nilai default:False
Diperlukan:False
Terima input alur:True
Terima karakter wildcard:False

-EnableIpConnect

IP Connect

Jenis:Nullable<T>[Boolean]
Position:Named
Nilai default:False
Diperlukan:False
Terima input alur:True
Terima karakter wildcard:False

-EnableKerberos

Kerberos

Jenis:Nullable<T>[Boolean]
Position:Named
Nilai default:False
Diperlukan:False
Terima input alur:True
Terima karakter wildcard:False

-EnableSessionRecording

Perekaman Sesi

Jenis:Nullable<T>[Boolean]
Position:Named
Nilai default:None
Diperlukan:False
Terima input alur:True
Terima karakter wildcard:False

Tautan yang Dapat Dibagikan

Jenis:Nullable<T>[Boolean]
Position:Named
Nilai default:False
Diperlukan:False
Terima input alur:True
Terima karakter wildcard:False

-EnableTunneling

Klien Asli

Jenis:Nullable<T>[Boolean]
Position:Named
Nilai default:False
Diperlukan:False
Terima input alur:True
Terima karakter wildcard:False

-Name

Nama sumber daya bastion.

Jenis:String
Alias:ResourceName, BastionName
Position:Named
Nilai default:None
Diperlukan:True
Terima input alur:False
Terima karakter wildcard:False

-PublicIpAddress

Objek alamat IP publik untuk bastion.

Jenis:PSPublicIpAddress
Alias:PublicIpAddressObject
Position:Named
Nilai default:None
Diperlukan:True
Terima input alur:False
Terima karakter wildcard:False

-PublicIpAddressId

Alamat Ip publik Id sumber daya Azure untuk bastion.

Jenis:String
Alias:PublicIpAddressResourceId
Position:Named
Nilai default:None
Diperlukan:True
Terima input alur:False
Terima karakter wildcard:False

-PublicIpAddressName

Nama sumber daya alamat IP publik untuk bastion.

Jenis:String
Position:Named
Nilai default:None
Diperlukan:True
Terima input alur:False
Terima karakter wildcard:False

-PublicIpAddressRgName

Nama grup sumber daya alamat IP publik untuk bastion.

Jenis:String
Alias:PublicIpAddressResourceGroupName
Position:Named
Nilai default:None
Diperlukan:True
Terima input alur:False
Terima karakter wildcard:False

-ResourceGroupName

Nama grup sumber daya tempat Anda perlu membuat bastion.

Jenis:String
Position:Named
Nilai default:None
Diperlukan:True
Terima input alur:False
Terima karakter wildcard:False

-ScaleUnit

Unit Skala untuk BastionHost

Jenis:Nullable<T>[Int32]
Position:Named
Nilai default:2
Diperlukan:False
Terima input alur:True
Terima karakter wildcard:False

-Sku

Tingkat Sku Bastion

Jenis:String
Nilai yang diterima:Basic, Standard, Premium
Position:Named
Nilai default:Basic
Diperlukan:False
Terima input alur:True
Terima karakter wildcard:False

-Tag

Hashtable yang mewakili tag sumber daya.

Jenis:Hashtable
Position:Named
Nilai default:None
Diperlukan:False
Terima input alur:False
Terima karakter wildcard:False

-VirtualNetwork

Objek jaringan virtual untuk bastion.

Jenis:PSVirtualNetwork
Alias:VirtualNetworkObject
Position:Named
Nilai default:None
Diperlukan:True
Terima input alur:False
Terima karakter wildcard:False

-VirtualNetworkId

Id sumber daya Azure jaringan virtual untuk bastion.

Jenis:String
Alias:VirtualNetworkResourceId
Position:Named
Nilai default:None
Diperlukan:True
Terima input alur:False
Terima karakter wildcard:False

-VirtualNetworkName

Nama sumber daya jaringan virtual untuk bastion.

Jenis:String
Position:Named
Nilai default:None
Diperlukan:True
Terima input alur:False
Terima karakter wildcard:False

-VirtualNetworkRgName

Nama grup sumber daya jaringan virtual untuk bastion.

Jenis:String
Alias:VirtualNetworkResourceGroupName
Position:Named
Nilai default:None
Diperlukan:True
Terima input alur:False
Terima karakter wildcard:False

-WhatIf

Menunjukkan apa yang akan terjadi jika cmdlet berjalan. Cmdlet tidak dijalankan.

Jenis:SwitchParameter
Alias:wi
Position:Named
Nilai default:None
Diperlukan:False
Terima input alur:False
Terima karakter wildcard:False

Input

String

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]]

Output

PSBastion