Enable-EOPProtectionPolicyRule
此指令程式只能在雲端式服務中使用。
使用 Enable-EOPProtectionPolicyRule 指令小子開啟 Standard 預設的安全政策或嚴格預設的安全政策。 如果你的組織有 Defender for Office 365,你也需要使用 Enable-ATPProtectionPolicyRule 指令檔來啟用該政策。
如需下方<語法>一節中參數集的詳細資訊,請參閱 Exchange Cmdlet 語法。
語法
Default (預設值)
Enable-EOPProtectionPolicyRule
[-Identity] <RuleIdParameter>
[-Confirm]
[-WhatIf]
[<CommonParameters>]
Description
與預設安全政策相關的規則中的狀態屬性會顯示該規則是啟用還是停用。
欲了解更多關於 PowerShell 預設安全政策的資訊,請參閱 Exchange Online PowerShell 中的預設安全政策。
您必須已獲指派權限,才能執行此指令程式。 雖然這篇文章列出了 cmdlet 的所有參數,但如果某些參數未包含在你分配的權限中,你可能無法存取這些參數。 若要尋找在組織中執行任何 Cmdlet 或參數所需的權限,請參閱 Find the permissions required to run any Exchange cmdlet。
範例
範例 1
Enable-EOPProtectionPolicyRule -Identity "Standard Preset Security Policy"
在沒有 Defender for Office 365 的組織中,此範例會關閉 Standard 預設的安全政策。 規則的州屬性值現在已啟用。
範例 2
Enable-EOPProtectionPolicyRule -Identity "Standard Preset Security Policy"; Enable-ATPProtectionPolicyRule -Identity "Standard Preset Security Policy"
在使用 Defender for Office 365 的組織中,此範例啟用 Standard 預設安全政策。 兩條規則的州屬性值現在都已啟用。
參數
-Confirm
適用:Exchange Online,內建本地信箱安全外掛
Confirm 參數會指定要顯示或隱藏確認提示。 這個參數對 Cmdlet 的影響取決於 Cmdlet 是否需要確認才能繼續作業。
- 破壞性的 Cmdlet (如 Remove-* cmdlets) 有內建暫停,它會先強迫您確認命令才會繼續作業。 對於這些 Cmdlet,您可以使用以下確切語法來略過確認提示:-Confirm:$false。
- 其他大部分的 Cmdlet (如 New-* 和 Set-* cmdlets) 則沒有內建暫停。 在使用這些 Cmdlet 時,指定不含任何值的 Confirm 參數會引入強迫您認可命令後才繼續作業的暫停。
參數屬性
| 類型: | SwitchParameter |
| 預設值: | None |
| 支援萬用字元: | False |
| 不要顯示: | False |
| 別名: | 參見 |
參數集
(All)
| Position: | Named |
| 必要: | False |
| 來自管線的值: | False |
| 來自管線按屬性名稱的值: | False |
| 來自剩餘引數的值: | False |
-Identity
適用:Exchange Online,內建本地信箱安全外掛
Identity 參數指定你想要啟用的規則。 您可以使用唯一識別規則的任何值。 例如:
- 名稱
- 辨別名稱 (DN)
- GUID
預設情況下,可用規則 (存在) 名稱Standard預設安全政策(Preset Security Policy)和嚴格預設安全政策(Strict Preset Security Policy)。
參數屬性
| 類型: | RuleIdParameter |
| 預設值: | None |
| 支援萬用字元: | False |
| 不要顯示: | False |
參數集
(All)
| Position: | 0 |
| 必要: | True |
| 來自管線的值: | True |
| 來自管線按屬性名稱的值: | True |
| 來自剩餘引數的值: | False |
-WhatIf
適用:Exchange Online,內建本地信箱安全外掛
WhatIf 參數會模擬命令的動作。 使用此參數時,您不需要實際套用變更即可檢視可能會發生的變更。 您不需要使用此參數指定值。
參數屬性
| 類型: | SwitchParameter |
| 預設值: | None |
| 支援萬用字元: | False |
| 不要顯示: | False |
| 別名: | 威斯康辛 |
參數集
(All)
| Position: | Named |
| 必要: | False |
| 來自管線的值: | False |
| 來自管線按屬性名稱的值: | False |
| 來自剩餘引數的值: | False |
CommonParameters
此 cmdlet 支援常見參數:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 如需詳細資訊,請參閱 about_CommonParameters。