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

部署 Microsoft Entra Password Protection 之後,監視和報告是基本工作。 本文將詳細說明,以協助您瞭解各種監視技術,包括每個服務記錄資訊的位置,以及如何報告 Microsoft Entra Password Protection 的使用方式。

監視和報告是透過事件記錄檔訊息或執行 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 全域原則、組織原則或組合而失敗。
  • 目前密碼原則的稽核模式是否為開啟或關閉。

金鑰密碼驗證相關事件如下所示:

Event 密碼變更 密碼集
通過 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-AzureADPasswordProtectionSummaryReportCmdlet 可用來產生密碼驗證活動的摘要檢視。 此 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 代理程式。

Cmdlet Get-AzureADPasswordProtectionSummaryReport 的運作方式是查詢 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'。

注意

此 Cmdlet 的運作方式是遠端查詢每個 DC 代理程式服務的管理員事件記錄檔。 如果事件記錄檔包含大量事件,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 Password Protection)

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 Password Protection 的效能計數器物件。 目前有下列效能計數器可供使用:

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

DC 代理程式探索

Get-AzureADPasswordProtectionDCAgentCmdlet 可用來顯示網域或樹系中執行之各種 DC 代理程式的基本資訊。 此資訊是從執行中的 DC 代理程式服務所註冊的服務連線ionPoint 物件(s) 擷取。

此 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 參數的影響。

如果活動訊號UTC 值過時,這可能是該網域控制站上的 Microsoft Entra Password Protection DC 代理程式未執行或已卸載,或電腦已降級且不再是網域控制站的徵兆。

如果 PasswordPolicyDateUTC 值過時,這可能是該電腦上 Microsoft Entra Password Protection 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

上述事件未指定較新的軟體版本。 您應該前往事件訊息中的連結以取得該資訊。

注意

儘管上述事件訊息中有「自動升級」的參考,但 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 Password Protection PowerShell Cmdlet 都會寫入位於下列位置的文字記錄:

%ProgramFiles%\Azure AD Password Protection Proxy\Logs

如果發生 Cmdlet 錯誤,而且原因和\或解決方案並不明顯,也可能諮詢這些文字記錄。

Proxy 探索

Get-AzureADPasswordProtectionProxyCmdlet 可用來顯示網域或樹系中執行的各種 Microsoft Entra Password Protection Proxy 服務的基本資訊。 此資訊是從執行中的 Proxy 服務註冊的服務連線ionPoint 物件(s) 擷取。

此 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 參數的影響。

如果活動訊號UTC 值過時,這可能是該電腦上 Microsoft Entra Password Protection 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 代理程式已設定已啟用自動升級,也會發出此事件。

下一步

Microsoft Entra 密碼保護的疑難排解

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