0
A
回答
2
以下是如何使用DirectoryEntry
和DirectorySearcher
搜索已刪除的用戶。如果將底層對象設爲UserPrincipal
確實很簡單,那麼可以使用cast
user
對象作爲UserPrincipal
。
public static void searchDeletedUsers()
{
using (DirectoryEntry entry = new DirectoryEntry("LDAP://yourldappath.com"))
{
using (DirectorySearcher searcher = new DirectorySearcher(entry))
{
searcher.Filter = "(&(isDeleted=TRUE)(objectclass=user))";
searcher.Tombstone = true;
var users = searcher.FindAll();
foreach(var user in users)
{
//user will contain the deleted user object
}
}
}
}
相關問題
- 1. VB.NET從活動目錄中刪除用戶
- 2. 從活動目錄中讀取objectGUID
- 3. 如何從asp.net中的活動目錄中刪除用戶帳戶
- 4. 使用c#在windows active目錄中獲取已刪除用戶
- 5. 從已刪除的文件中讀取
- 6. 如何在活動目錄中查看已刪除的對象
- 7. 如何刪除活動記錄中已刪除行的ID
- 8. 活動目錄auth Tomcat - 在操作中讀取用戶名?
- 9. 問題從本地網絡上的活動目錄中讀取用戶的UserLoginName
- 10. 如何從活動登錄表中刪除用戶名?
- 11. 如何從Azure活動目錄中刪除應用程序?
- 12. 從目錄中刪除只讀屬性
- 13. 刪除同步的azure活動目錄
- 14. 從活動目錄獲取當前登錄用戶的列表
- 15. 從活動目錄中獲取任何用戶的類型
- 16. 從活動目錄中獲取用戶的密碼
- 17. 如何從MVC中的活動目錄獲取用戶列表?
- 18. 可以從Eclipse中自動刪除已刪除的項目嗎?
- 19. 從活動目錄組中獲取聯繫人和用戶
- 20. 從活動目錄中提取用戶列表
- 21. 從PHP讀取用戶主目錄
- 22. 讀取目錄中除
- 23. 活動目錄logonCount爲0,雖然用戶已登錄
- 24. 從活動目錄中獲取任何用戶的用戶名和暱稱
- 25. 如何從Jxplorer獲取活動目錄用戶的UID
- 26. 刪除組中的單個用戶 - 活動記錄
- 27. 刪除/從活動
- 28. 從backStack中刪除活動
- 29. 在php中讀取已刪除的記錄
- 30. 刪除已認證用戶的讀取數據?