共用方式為


Remove-AzureNetworkSecurityGroupAssociation

拿掉網路安全組。

注意

本文件中參考的 Cmdlet 用於管理使用 Azure Service Manager(ASM) API 的舊版 Azure 資源。 建立新的資源時,不建議使用此舊版 PowerShell 模組,因為 ASM 已排定淘汰。 如需詳細資訊,請參閱 Azure Service Manager 淘汰

Az PowerShell 模組是使用 PowerShell 管理 Azure Resource Manager (ARM) 資源的建議 PowerShell 模組。

語法

Remove-AzureNetworkSecurityGroupAssociation
      -Name <String>
      -VirtualNetworkName <String>
      -SubnetName <String>
      [-Force]
      [-PassThru]
      [-Profile <AzureSMProfile>]
      [<CommonParameters>]
Remove-AzureNetworkSecurityGroupAssociation
      -Name <String>
      -VM <PersistentVMRoleContext>
      -ServiceName <String>
      [-NetworkInterfaceName <String>]
      [-Force]
      [-PassThru]
      [-Profile <AzureSMProfile>]
      [<CommonParameters>]
Remove-AzureNetworkSecurityGroupAssociation
      -Name <String>
      [-Slot <String>]
      -RoleName <String>
      -ServiceName <String>
      [-NetworkInterfaceName <String>]
      [-Force]
      [-PassThru]
      [-Profile <AzureSMProfile>]
      [<CommonParameters>]

Description

Remove-AzureNetworkSecurityGroupAssociation Cmdlet 會從虛擬機移除網路安全組。

範例

範例 1:將虛擬機器移除至網路安全組

PS C:\> Get-AzureVM -ServiceName "ContosoService" -Name "ContosoVM06" | Remove-AzureNetworkSecurityGroupAssociation -Name "ContosoNetworkSecurityGroup"

此命令會針對名為 ContosoService 的服務取得名為 ContosoVM06 的虛擬機,並將該虛擬機對象傳遞至目前的 Cmdlet。 目前的 Cmdlet 會從該虛擬機中移除名為 ContosoNetworkSecurityGroup 的網路安全組。

參數

-Force

強制命令執行,而不要求使用者確認。

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Name

指定此 Cmdlet 移除的網路安全組名稱。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-NetworkInterfaceName

指定此 Cmdlet 從中移除網路安全組的網路適配器名稱。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-PassThru

會傳回 物件,代表您正在使用的專案。 根據預設,此 Cmdlet 不會產生任何輸出。

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Profile

指定此 Cmdlet 從中讀取的 Azure 設定檔。 如果您未指定設定檔,此 Cmdlet 會從本機預設配置檔讀取。

類型:AzureSMProfile
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-RoleName

指定此 Cmdlet 從中移除網路安全組的 PaaS 角色名稱。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-ServiceName

指定雲端服務的名稱。 此 Cmdlet 從中移除網路安全組所屬服務的 PaaS 角色。此參數所指定的服務。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-Slot

指定 PaaS 位置。 此 Cmdlet 從中移除網路安全組的 PaaS 角色具有此參數所指定的位置。 有效值為:

  • Production
  • 預備

預設值為 [生產]。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-SubnetName

指定此 Cmdlet 從中移除網路安全組的子網名稱。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-VirtualNetworkName

指定包含此 Cmdlet 移除網路安全組之子網的虛擬網路名稱。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-VM

指定此 Cmdlet 套用網路安全組的虛擬機。

類型:PersistentVMRoleContext
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

輸出

Boolean