New-AzNetworkManagerSecurityAdminRule
建立安全性系統管理員規則。
語法
New-AzNetworkManagerSecurityAdminRule
-Name <String>
-RuleCollectionName <String>
-SecurityAdminConfigurationName <String>
-NetworkManagerName <String>
-ResourceGroupName <String>
[-Description <String>]
-Protocol <String>
-Direction <String>
-Access <String>
[-SourceAddressPrefix <PSNetworkManagerAddressPrefixItem[]>]
[-DestinationAddressPrefix <PSNetworkManagerAddressPrefixItem[]>]
[-SourcePortRange <String[]>]
[-DestinationPortRange <String[]>]
-Priority <Int32>
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzNetworkManagerSecurityAdminRule
-Name <String>
-RuleCollectionName <String>
-SecurityAdminConfigurationName <String>
-NetworkManagerName <String>
-ResourceGroupName <String>
-Flag <String>
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
New-AzNetworkManagerSecurityAdminRule Cmdlet 會建立安全性系統管理員規則。
範例
範例 1:建立自訂安全性管理規則
$sourceAddressPrefix = New-AzNetworkManagerAddressPrefixItem -AddressPrefix "Internet" -AddressPrefixType "ServiceTag"
$destinationAddressPrefix = New-AzNetworkManagerAddressPrefixItem -AddressPrefix "10.0.0.1" -AddressPrefixType "IPPrefix"
$sourcePortList = @("100")
$destinationPortList = @("99")
New-AzNetworkManagerSecurityAdminRule -ResourceGroupName "psResourceGroup" -NetworkManagerName "psNetworkManager" -ConfigName "psSecurityAdminConfig" -RuleCollectionName "psRuleCollection" -Name "psRule" -Description "TestDescription" -Protocol "TCP" -Direction "Inbound" -Access "Allow" -Priority 100 -SourcePortRange $sourcePortList -DestinationPortRange $destinationPortList -SourceAddressPrefix $sourceAddressPrefix -DestinationAddressPrefix $destinationAddressPrefix
Protocol : Tcp
Direction : Inbound
Sources : {Microsoft.Azure.Commands.Network.Models.NetworkManager.PSNetworkManagerAddressPrefixItem}
Destinations : {Microsoft.Azure.Commands.Network.Models.NetworkManager.PSNetworkManagerAddressPrefixItem}
SourcePortRanges : {100}
DestinationPortRanges : {99}
Access : Allow
Priority : 100
SourcesText : [
{
"AddressPrefix": "Internet",
"AddressPrefixType": "ServiceTag"
}
]
DestinationsText : [
{
"AddressPrefix": "10.0.0.1",
"AddressPrefixType": "IPPrefix"
}
]
SourcePortRangesText : [
"100"
]
DestinationPortRangesText : [
"99"
]
DisplayName :
Description : TestDescription
Type : Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections/rules
ProvisioningState : Succeeded
SystemData : Microsoft.Azure.Commands.Network.Models.NetworkManager.PSSystemData
SystemDataText : {
"CreatedBy": "jaredgorthy@microsoft.com",
"CreatedByType": "User",
"CreatedAt": "2022-08-08T00:39:56.4512419Z",
"LastModifiedBy": "jaredgorthy@microsoft.com",
"LastModifiedByType": "User",
"LastModifiedAt": "2022-08-08T00:39:56.4512419Z"
}
Name : psRule
Etag :
Id : /subscriptions/f0dc2b34-dfad-40e4-83e0-2309fed8d00b/resourceGroups/psResourceGroup/providers/Microsoft.Network/networkManagers/psNetworkManager/securityAdminConfigurations/psSecurityAdminConfig/ruleCollections/psRuleCollection/rules/psRule
建立安全性系統管理員規則。
參數
-Access
規則的存取權。
類型: | String |
接受的值: | Allow, Deny, AlwaysAllow |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-AsJob
在背景執行 Cmdlet
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Confirm
在執行 Cmdlet 之前,提示您進行確認。
類型: | SwitchParameter |
別名: | cf |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-DefaultProfile
用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。
類型: | IAzureContextContainer |
別名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Description
描述。
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-DestinationAddressPrefix
目的地地址前綴。
類型: | PSNetworkManagerAddressPrefixItem[] |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-DestinationPortRange
目的地埠範圍。
類型: | String[] |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-Direction
規則的方向。
類型: | String |
接受的值: | Inbound, Outbound |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-Flag
默認旗標類型。
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-Force
如果您想要覆寫資源,請勿要求確認
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Name
資源名稱。
類型: | String |
別名: | ResourceName |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | True |
-NetworkManagerName
網路管理員名稱。
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | True |
-Priority
規則的優先順序。
類型: | Int32 |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-Protocol
規則的通訊協定。
類型: | String |
接受的值: | Tcp, Udp, Icmp, Esp, Any, Ah |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-ResourceGroupName
資源組名。
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-RuleCollectionName
網路管理員安全性管理員規則集合名稱。
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | True |
-SecurityAdminConfigurationName
網路管理員安全性系統管理員組態名稱。
類型: | String |
別名: | ConfigName |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | True |
-SourceAddressPrefix
來源位址前置詞。
類型: | PSNetworkManagerAddressPrefixItem[] |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-SourcePortRange
來源埠範圍。
類型: | String[] |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-WhatIf
顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。
類型: | SwitchParameter |
別名: | wi |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
輸入
PSNetworkManagerAddressPrefixItem[]
System.String[]
輸出
PSNetworkManagerSecurityBaseAdminRule