Windows-Server-2008

數字字元串類型的 AD 自定義屬性在更新時會導致 MMC 崩潰

  • January 12, 2022

我正在使用 Windows Server 2008。我有一個帶有一個域控制器的域(這是一個開發環境)。我編輯了 AD 架構並創建了一個名為 TestAttribute2(LDAP 名稱為 testAttribute2)的自定義屬性,其語法為數字字元串、單值,沒有最小值或最大值。該屬性的 OID 為 1.3.6.1.4.1.39668.21769.1.1.1。我還創建了另一個測試屬性,其 Microsoft 發布的 OID 為 1.2.840.113556.1.8000.2554.37861.10620.51629.17372.38569.15288078.14709744.1.2。該屬性是非索引的、活動的、不復製到 GC、複製時不複製,並且不為容器化搜尋編制索引。然後我將此屬性添加到 person 類中。

每當我嘗試使用 AD 使用者和電腦 MMC 的屬性編輯器功能或 ADSI Edit 設置這些自定義屬性中的任何一個時,MMC 都會崩潰,並且該屬性仍未設置。但是,可以設置具有類似 OID 但具有其他語法(CI 字元串和 Unicode 字元串)的其他自定義屬性而不會崩潰。我究竟做錯了什麼?

嘗試使用 ADSI 編輯編輯非“多值”類型的“數字字元串”屬性時會發生此崩潰。為 mmc.exe 啟用了應用程序驗證程序,我們可以看到此類崩潰的堆棧跟踪,它似乎在嘗試刪除值數組時崩潰:

0:005> k
# Child-SP          RetAddr               Call Site
00 00000000`0c7ee660 00000000`76cdc4ca     vfbasics!AVrfpRtlFreeHeap+0x62
01 00000000`0c7ee730 000007fe`fd6e10c0     kernel32!HeapFree+0xa
02 00000000`0c7ee760 000007fe`f3554ef0     msvcrt!free+0x1c
03 00000000`0c7ee790 000007fe`ec973d77     vfbasics!AVrfp_deletearray+0x30
04 00000000`0c7ee7c0 000007fe`ec9743e6     adsiedit!DeleteADsValues+0x97
05 00000000`0c7ee7f0 000007fe`ec97c145     adsiedit!CSingleStringEditor::GetNewValue+0x1b6
06 00000000`0c7ee840 000007fe`ec97bf10     adsiedit!CAttributeEditorPropertyPage::EditAttribute+0x149
07 00000000`0c7ee900 000007fe`f334abdb     adsiedit!CAttributeEditorPropertyPage::OnNotifyEditAttribute+0x54
08 00000000`0c7ee930 000007fe`f334ae0b     mfc42u!_AfxDispatchCmdMsg+0x83
09 00000000`0c7ee960 000007fe`f334198e     mfc42u!CCmdTarget::OnCmdMsg+0x17b
0a 00000000`0c7ee9b0 000007fe`f332160d     mfc42u!CPropertySheet::OnCmdMsg+0x32
0b 00000000`0c7ee9f0 000007fe`f3340fc2     mfc42u!CWnd::OnNotify+0xa5
0c 00000000`0c7eea50 000007fe`ec97eb78     mfc42u!CPropertyPage::OnNotify+0x22
0d 00000000`0c7eea80 000007fe`f3320ab8     adsiedit!CAttributeEditorPropertyPage::OnNotify+0x54
0e 00000000`0c7eeab0 000007fe`f33209f8     mfc42u!CWnd::OnWndMsg+0x8c
0f 00000000`0c7eebb0 000007fe`f331ef25     mfc42u!CWnd::WindowProc+0x38
10 00000000`0c7eebf0 000007fe`f331f329     mfc42u!AfxCallWndProc+0xe1
11 00000000`0c7eec90 000007fe`ec987a95     mfc42u!AfxWndProc+0x59
12 00000000`0c7eecd0 00000000`76bfd53e     adsiedit!AfxWndProcDllStatic+0x49
13 00000000`0c7eed20 00000000`76bfc62b     user32!UserCallWinProcCheckWow+0x1ad
14 00000000`0c7eede0 00000000`76bfc71d     user32!DispatchClientMessage+0xc3
15 00000000`0c7eee40 00000000`76e26c26     user32!_fnDWORD+0x2d
16 00000000`0c7eeea0 00000000`76bfb20a     ntdll!KiUserCallbackDispatcherContinue
17 00000000`0c7eef28 00000000`76bf7abb     user32!ZwUserMessageCall+0xa
18 00000000`0c7eef30 00000000`76bfb649     user32!SendMessageWorker+0x73f
19 00000000`0c7eefc0 000007fe`fb4247f7     user32!SendMessageW+0x5b
1a 00000000`0c7ef010 000007fe`fb518b89     comctl32_7fefb3f0000!CCSendNotify+0xf93
1b 00000000`0c7ef130 000007fe`fb47d681     comctl32_7fefb3f0000!CLVMouseManager::HandleMouse+0x7bd
1c 00000000`0c7ef280 000007fe`fb47cc68     comctl32_7fefb3f0000!CListView::WndProc+0x9cd
1d 00000000`0c7ef480 00000000`76bfd53e     comctl32_7fefb3f0000!CListView::s_WndProc+0x6c4
1e 00000000`0c7ef4e0 00000000`76bfd7c6     user32!UserCallWinProcCheckWow+0x1ad
1f 00000000`0c7ef5a0 00000000`76bfd174     user32!DispatchMessageWorker+0x389
20 00000000`0c7ef620 000007fe`fb439d0d     user32!IsDialogMessageW+0x14f
21 00000000`0c7ef6b0 000007fe`fb43c063     comctl32_7fefb3f0000!Prop_IsDialogMessage+0x1f1
22 00000000`0c7ef720 000007fe`fb43c43d     comctl32_7fefb3f0000!_RealPropertySheet+0x31b
23 00000000`0c7ef7f0 000007fe`f0fa2c58     comctl32_7fefb3f0000!_PropertySheet+0x55
24 00000000`0c7ef830 000007fe`f0fa2e30     mmcndmgr!MmcIsolationAwarePropertySheet+0x68
25 00000000`0c7ef860 000007fe`f0fa2bc7     mmcndmgr!PropertySheetProc+0x1a0
26 00000000`0c7ef8f0 000007fe`fd6e3ea7     mmcndmgr!PropertySheetThreadProc+0x9f
27 00000000`0c7ef920 000007fe`fd6e6635     msvcrt!endthreadex+0x47
28 00000000`0c7ef950 00000000`76ccbe3d     msvcrt!endthreadex+0x100
29 00000000`0c7ef980 00000000`76e06a51     kernel32!BaseThreadInitThunk+0xd
2a 00000000`0c7ef9b0 00000000`00000000     ntdll!RtlUserThreadStart+0x1d

潛在的解決方案/解決方法包括

  1. 將 Windows Server 2019 / Windows 10 中的 ADSI Edit 與遠端伺服器管理工具一起使用,沒有此問題。
  2. 將屬性創建為數字字元串以外的類型
  3. 將屬性創建為數字字元串“多值”
  4. 不要使用 ADSI Edit 來編輯值,即 AD Explorer 工作正常,儘管在 2008 年您將不得不使用舊版本,即https://web.archive.org/web/20110601/https://download.sysinternals。 com/files/AdExplorer.zip

引用自:https://serverfault.com/questions/406467