共用方式為


監視和查看內部部署 Microsoft Entra 密碼保護環境的記錄

部署 Microsoft Entra 密碼保護之後,監視和報告即為必要工作。 本文將深入探討以協助您瞭解各種監視技術,包括每個服務要將資訊記錄於何處,以及如何報告 Microsoft Entra 密碼保護的使用情形。

監視和報告都會透過事件記錄檔訊息或執行 PowerShell Cmdlet 來完成。 DC 代理程式和 Proxy 服務都會記錄事件記錄檔訊息。 以下所述的所有 PowerShell Cmdlet 皆僅適用於 Proxy 伺服器 (請參閱 AzureADPasswordProtection PowerShell 模組)。 DC 代理程式軟體不會安裝 PowerShell 模組。

DC 代理程式事件記錄

在每個網域控制站上,DC 代理程式服務軟體會將每個個別密碼驗證作業的結果 (及其他狀態) 寫入至本機事件記錄檔:

\Applications and Services Logs\Microsoft\AzureADPasswordProtection\DCAgent\Admin

\Applications and Services Logs\Microsoft\AzureADPasswordProtection\DCAgent\Operational

\Applications and Services Logs\Microsoft\AzureADPasswordProtection\DCAgent\Trace

DC 代理程式的系統管理記錄是有關軟體如何運作之資訊的主要來源。

請注意,追蹤記錄檔預設會關閉。

由各種 DC 代理程式元件所記錄的事件會介於下列範圍內:

元件 事件識別碼範圍
DC 代理程式密碼篩選 dll 10000-19999
DC 應用程式服務裝載處理序 20000-29999
DC 代理程式服務原則驗證邏輯 30000-39999

DC 代理程式系統管理事件記錄檔

密碼驗證結果事件

在每個網域控制站上,DC 代理程式服務軟體會將每個個別密碼驗證的結果寫入至 DC 代理程式系統管理事件記錄檔。

就成功的密碼驗證作業而言,通常會有一個從 DC 代理程式密碼篩選 dll 記錄的事件。 如果密碼驗證作業失敗,則通常會記錄兩個事件,一個來自 DC 代理程式服務,另一個來自 DC 代理程式密碼篩選 dll。

系統會根據下列因素,記錄會擷取這些情況的離散事件:

  • 指定的密碼是否設定或變更。
  • 指定密碼的驗證是通過還是失敗。
  • 驗證是否會因為 Microsoft 全域原則、組織原則或組合有所衝突而失敗。
  • 目前的密碼原則目前是否開啟僅限稽核模式。

主要的密碼驗證相關事件如下:

活動 密碼變更 密碼設定
通過 10014 10015
失敗 (由於客戶密碼原則) 10016、30002 10017、30003
失敗 (由於 Microsoft 密碼原則) 10016、30004 10017、30005
失敗 (由於 Microsoft 和客戶密碼原則的組合) 10016、30026 10017、30027
失敗 (由於使用者名稱) 10016、30021 10017、30022
僅限稽核通過 (將不會通過客戶密碼原則) 10024、30008 10025、30007
僅限稽核通過 (將不會通過 Microsoft 密碼原則) 10024、30010 10025、30009
僅限稽核通過 (將不會通過 Microsoft 和客戶密碼原則的組合) 10024、30028 10025、30029
僅限稽核通過 (會因為使用者名稱而失敗) 10016、30024 10017、30023

上表中參考「原則組合」的案例是指下列情況:發現使用者的密碼至少包含一個同時來自 Microsoft 禁用密碼清單和客戶禁用密碼清單的權杖。

上表中參考「使用者名稱」的案例,是指使用者密碼必須包含使用者的帳戶名稱和/或其中一個使用者自訂名稱的情況。 這兩種情況都會導致當原則設定為強制執行時,使用者的密碼會遭到拒絕,或在處於稽核模式時通過。

一起記錄一對事件時,這兩個事件會因為具有同一個 CorrelationId 而明確地產生關聯。

透過 PowerShell 報告的密碼驗證摘要

Get-AzureADPasswordProtectionSummaryReport Cmdlet 可能會用來產生密碼驗證活動的摘要檢視。 此 Cmdlet 的範例輸出如下:

Get-AzureADPasswordProtectionSummaryReport -DomainController bplrootdc2
DomainController                : bplrootdc2
PasswordChangesValidated        : 6677
PasswordSetsValidated           : 9
PasswordChangesRejected         : 10868
PasswordSetsRejected            : 34
PasswordChangeAuditOnlyFailures : 213
PasswordSetAuditOnlyFailures    : 3
PasswordChangeErrors            : 0
PasswordSetErrors               : 1

此 Cmdlet 的報告範圍可使用 –Forest、-Domain 或 –DomainController 參數的其中一個來加以影響。 未指定參數意指 –Forest。

注意

如果您只在一個 DC 上安裝 DC 代理程式,則 Get-AzureADPasswordProtectionSummaryReport 只會讀取來自該 DC 的事件。 若要從多個 DC 取得事件,您需要在每個 DC 上安裝 DC 代理程式。

Get-AzureADPasswordProtectionSummaryReport Cmdlet 的運作方式是查詢 DC 代理程式系統管理事件記錄檔,然後計算對應至每個顯示之結果類別的事件總數。 下表包含每個結果及其對應事件識別碼間的對應:

Get-AzureADPasswordProtectionSummaryReport 屬性 對應的事件識別碼
PasswordChangesValidated 10014
PasswordSetsValidated 10015
PasswordChangesRejected 10016
PasswordSetsRejected 10017
PasswordChangeAuditOnlyFailures 10024
PasswordSetAuditOnlyFailures 10025
PasswordChangeErrors 10012
PasswordSetErrors 10013

請注意,Get-AzureADPasswordProtectionSummaryReport Cmdlet 隨附於 PowerShell 指令碼表單,而且必要時,可於下列位置直接參考:

%ProgramFiles%\WindowsPowerShell\Modules\AzureADPasswordProtection\Get-AzureADPasswordProtectionSummaryReport.ps1

注意

此 Cmdlet 的運作方式是針對每個網域控制站開啟 PowerShell 工作階段。 每個網域控制站上都必須啟用 PowerShell 遠端供作階段支援,且用戶端必須要有足夠權限,才能成功。 如需 PowerShell 遠端工作階段需求的詳細資訊,請在 Powershell 視窗中,執行 'Get-help about_Remote_Troubleshooting'。

注意

從遠端查詢每個 DC 代理程式服務的系統管理事件記錄即可讓此 Cmdlet 運作。 如果事件記錄包含大量事件,此 Cmdlet 可能需要很長的時間才能完成。 此外,透過網路大量查詢大型資料集可能會影響網域控制站的效能。 因此,在生產環境中請小心使用這個 Cmdlet。

事件記錄檔訊息範例

事件識別碼 10014 (密碼變更成功)

The changed password for the specified user was validated as compliant with the current Azure password policy.

UserName: SomeUser
FullName: Some User

事件識別碼 10017 (密碼變更失敗):

The reset password for the specified user was rejected because it did not comply with the current Azure password policy. Please see the correlated event log message for more details.

UserName: SomeUser
FullName: Some User

事件識別碼 30003 (密碼變更失敗):

The reset password for the specified user was rejected because it matched at least one of the tokens present in the per-tenant banned password list of the current Azure password policy.

UserName: SomeUser
FullName: Some User

事件識別碼 10024 (密碼因為僅限稽核模式中的原則而被接受)

The changed password for the specified user would normally have been rejected because it did not comply with the current Azure password policy. The current Azure password policy is con-figured for audit-only mode so the password was accepted. Please see the correlated event log message for more details. 
 
UserName: SomeUser
FullName: Some User

事件識別碼 30008 (密碼因為僅限稽核模式中的原則而被接受)

The changed password for the specified user would normally have been rejected because it matches at least one of the tokens present in the per-tenant banned password list of the current Azure password policy. The current Azure password policy is configured for audit-only mode so the password was accepted. 

UserName: SomeUser
FullName: Some User

事件識別碼 30001 (密碼因為沒有可用原則而被接受)

The password for the specified user was accepted because an Azure password policy is not available yet

UserName: SomeUser
FullName: Some User

This condition may be caused by one or more of the following reasons:%n

1. The forest has not yet been registered with Azure.

   Resolution steps: an administrator must register the forest using the Register-AzureADPasswordProtectionForest cmdlet.

2. An Azure AD password protection Proxy is not yet available on at least one machine in the current forest.

   Resolution steps: an administrator must install and register a proxy using the Register-AzureADPasswordProtectionProxy cmdlet.

3. This DC does not have network connectivity to any Azure AD password protection Proxy instances.

   Resolution steps: ensure network connectivity exists to at least one Azure AD password protection Proxy instance.

4. This DC does not have connectivity to other domain controllers in the domain.

   Resolution steps: ensure network connectivity exists to the domain.

事件識別碼 30006 (強制執行新原則)

The service is now enforcing the following Azure password policy.

 Enabled: 1
 AuditOnly: 1
 Global policy date: ‎2018‎-‎05‎-‎15T00:00:00.000000000Z
 Tenant policy date: ‎2018‎-‎06‎-‎10T20:15:24.432457600Z
 Enforce tenant policy: 1

事件識別碼 30019 (已停用 Microsoft Entra 密碼保護)

The most recently obtained Azure password policy was configured to be disabled. All passwords submitted for validation from this point on will automatically be considered compliant with no processing performed.

No further events will be logged until the policy is changed.%n

DC 代理程式運作記錄

DC 代理程式服務也會將與運作有關的事件記錄至以下記錄:

\Applications and Services Logs\Microsoft\AzureADPasswordProtection\DCAgent\Operational

DC 代理程式追蹤記錄

DC 代理程式服務也可以將偵錯層級追蹤事件的詳細資訊記錄至以下記錄:

\Applications and Services Logs\Microsoft\AzureADPasswordProtection\DCAgent\Trace

依預設會停用追蹤記錄。

警告

啟用時,追蹤記錄會接收大量事件,而可能會影響網域控制站的效能。 因此,只有在問題需要更深入的調查時才應啟用此增強型記錄,且應盡可能縮短啟用時間。

DC 代理程式文字記錄

DC 代理程式服務可以透過設定以下登錄值,設定為寫入至文字記錄檔:

HKLM\System\CurrentControlSet\Services\AzureADPasswordProtectionDCAgent\Parameters!EnableTextLogging = 1 (REG_DWORD value)

依預設會停用文字記錄。 變更此值時需重新啟動 DC 代理程式服務,此變更才會生效。 啟用 DC 代理程式服務時,將會寫入位於以下位置的記錄檔:

%ProgramFiles%\Azure AD Password Protection DC Agent\Logs

提示

文字記錄會收到與可記錄至追蹤記錄的相同偵錯層級項目,但其格式通常是較容易檢閱和分析的格式。

警告

啟用時,此記錄會接收大量事件,而可能會影響網域控制站的效能。 因此,只有在問題需要更深入的調查時才應啟用此增強型記錄,且應盡可能縮短啟用時間。

DC 代理程式效能監視

DC 代理程式服務軟體會安裝名為 Microsoft Entra 密碼保護的效能計數器物件。 以下是目前可用的效能計數器:

效能計數器名稱 描述
已處理的密碼 此計數器會顯示自上次重新啟動後已處理 (已接受或拒絕) 的密碼總數。
已接受的密碼 此計數器會顯示自上次重新啟動後已接受的密碼總數。
已拒絕的密碼 此計數器會顯示自上次重新啟動後已拒絕的密碼總數。
進行中的密碼篩選要求 此計數器會顯示目前正在進行中的密碼篩選要求數目。
尖峰密碼篩選要求 此計數器會顯示自上次重新啟動後的並行密碼篩選要求的尖峰數目。
密碼篩選要求錯誤 此計數器會顯示自上次重新啟動後因錯誤而失敗的密碼篩選要求總數。 當 Microsoft Entra 密碼保護 DC 代理程式服務未執行時,就可能發生錯誤。
密碼篩選要求/秒 此計數器會顯示密碼的處理速率。
密碼篩選要求處理時間 此計數器會顯示處理密碼篩選要求所需的平均時間。
尖峰密碼篩選要求處理時間 此計數器會顯示自上次重新啟動後的尖峰密碼篩選要求處理時間。
因稽核模式而接受的密碼 此計數器會顯示自上次重新啟動後,在正常情況下會遭到拒絕、但因密碼原則設定為稽核模式而被接受的密碼總數。

DC 代理程式探索

Get-AzureADPasswordProtectionDCAgent Cmdlet 可用來顯示與執行於網域或樹系中的各種 DC 代理程式有關的基本資訊。 您可以從執行中的 DC 代理程式服務所註冊的 serviceConnectionPoint 物件中擷取這項資訊。

此 Cmdlet 的範例輸出如下:

Get-AzureADPasswordProtectionDCAgent
ServerFQDN            : bplChildDC2.bplchild.bplRootDomain.com
Domain                : bplchild.bplRootDomain.com
Forest                : bplRootDomain.com
PasswordPolicyDateUTC : 2/16/2018 8:35:01 AM
HeartbeatUTC          : 2/16/2018 8:35:02 AM

每個 DC 代理程式服務大約每小時會更新一次各種屬性。 資料仍會受限於 Active Directory 複寫延遲。

此 Cmdlet 的查詢範圍可使用 –Forest 或 –Domain 參數來變更。

如果 HeartbeatUTC 值過時,這可能是一個徵兆:該網域控制站上的 Microsoft Entra 密碼保護 DC 代理程式並未執行或已解除安裝,或者該機器已降級且不再是網域控制站。

如果 PasswordPolicyDateUTC 值過時,這可能是一個徵兆:該機器上的 Microsoft Entra 密碼保護 DC 代理程式運作不正常。

可用的較新 DC 代理程式版本

當偵測到有較新版本的 DC 代理程式軟體可供使用時,DC 代理程式服務會將 30034 警告事件記錄到操作記錄中,例如:

An update for Azure AD Password Protection DC Agent is available.

If autoupgrade is enabled, this message may be ignored.

If autoupgrade is disabled, refer to the following link for the latest version available:

https://aka.ms/AzureADPasswordProtectionAgentSoftwareVersions

Current version: 1.2.116.0

上述事件不會指定較新軟體的版本。 您應該移至事件訊息中的連結,以取得該資訊。

注意

儘管上述事件訊息中提到 "autoupgrade" 參考,DC 代理程式軟體目前仍不支援這項功能。

Proxy 服務事件記錄

Proxy 服務會發出最小集合的事件至下列事件記錄:

\Applications and Services Logs\Microsoft\AzureADPasswordProtection\ProxyService\Admin

\Applications and Services Logs\Microsoft\AzureADPasswordProtection\ProxyService\Operational

\Applications and Services Logs\Microsoft\AzureADPasswordProtection\ProxyService\Trace

請注意,追蹤記錄檔預設會關閉。

警告

啟用時,追蹤記錄會接收大量事件,而可能會影響 Proxy 主機的效能。 因此,只有在問題需要更深入的調查時才應啟用此記錄,且應盡可能縮短啟用時間。

事件會由各種 Proxy 元件使用下列範圍進行記錄:

元件 事件識別碼範圍
Proxy 服務裝載處理序 10000-19999
Proxy 服務核心商務邏輯 20000-29999
PowerShell Cmdlet 30000-39999

Proxy 服務文字記錄

Proxy 服務可以透過設定以下登錄值,設定為寫入至文字記錄檔:

HKLM\System\CurrentControlSet\Services\AzureADPasswordProtectionProxy\Parameters!EnableTextLogging = 1 (REG_DWORD 值)

依預設會停用文字記錄。 變更此值時需重新啟動 Proxy 服務,此變更才會生效。 啟用 Proxy 服務時,將會寫入位於以下位置的記錄檔:

%ProgramFiles%\Azure AD Password Protection Proxy\Logs

提示

文字記錄會收到與可記錄至追蹤記錄的相同偵錯層級項目,但其格式通常是較容易檢閱和分析的格式。

警告

啟用時,此記錄會接收大量事件,而可能會影響機器的效能。 因此,只有在問題需要更深入的調查時才應啟用此增強型記錄,且應盡可能縮短啟用時間。

PowerShell Cmdlet 記錄

導致狀態變更的 PowerShell Cmdlet (例如 Register-AzureADPasswordProtectionProxy) 通常會將結果事件記錄到作業記錄。

此外,大部分的 Microsoft Entra 密碼保護 PowerShell Cmdlet 都將寫入至位於以下位置的文字記錄:

%ProgramFiles%\Azure AD Password Protection Proxy\Logs

如果發生 Cmdlet 錯誤,且原因和/或解決方式不明顯,可能也會參考這些文字記錄。

Proxy 探索

Get-AzureADPasswordProtectionProxy Cmdlet 可能會用來顯示有關在網域或樹系中執行之各種 Microsoft Entra 密碼保護 Proxy 服務的基本資訊。 您可以從執行中 Proxy 服務所註冊的 serviceConnectionPoint 物件中擷取此資訊。

此 Cmdlet 的範例輸出如下:

Get-AzureADPasswordProtectionProxy
ServerFQDN            : bplProxy.bplchild2.bplRootDomain.com
Domain                : bplchild2.bplRootDomain.com
Forest                : bplRootDomain.com
HeartbeatUTC          : 12/25/2018 6:35:02 AM

每個 Proxy 服務大約每小時都會更新各種屬性。 資料仍會受限於 Active Directory 複寫延遲。

此 Cmdlet 的查詢範圍可使用 –Forest 或 –Domain 參數來變更。

如果 HeartbeatUTC 值過時,這可能是一個徵兆:該機器上的 Microsoft Entra 密碼保護 Proxy 並未執行或已解除安裝。

可用的較新 Proxy 代理程式版本

當偵測到有較新版本的 Proxy 軟體可供使用時,Proxy 服務會將 20002 警告事件記錄到操作記錄中,例如:

An update for Azure AD Password Protection Proxy is available.

If autoupgrade is enabled, this message may be ignored.

If autoupgrade is disabled, refer to the following link for the latest version available:

https://aka.ms/AzureADPasswordProtectionAgentSoftwareVersions

Current version: 1.2.116.0
.

上述事件不會指定較新軟體的版本。 您應該移至事件訊息中的連結,以取得該資訊。

即使 Proxy 代理程式設定啟用 autoupgrade,仍會發出此事件。

下一步

Microsoft Entra 密碼保護的疑難解答

如需關於全域和自訂禁用密碼清單的詳細資訊,請參閱禁用不當密碼一文