directoryentry

    2熱度

    1回答

    我可以很好地添加用戶,但是無法將其添加到本地組。我得到這個錯誤: - A member could not be added to or removed from the local group because the member does not exist. 這是我正在使用的代碼。我做錯了什麼?這只是本地機器,我絕對有權這樣做,並且該組明確存在。 try { us

    7熱度

    2回答

    我模擬用戶帳戶成功,但我無法使用模擬帳戶綁定到AD並拉下DirectoryEntry。 下面的代碼輸出: 模擬之前我:DOMAIN \用戶 模擬後我:DOMAIN \ ADMIN 錯誤:C:\用戶\用戶\ ADSI_Impersonation \ BIN \調試\ ADSI_Impersonation.exe SAM帳戶名: 我的問題似乎類似於: How to use the System.Dir

    2熱度

    1回答

    今天注意到一件奇怪的事情。在我正在進行的項目中,我有一些類似的代碼: var directoryEntry =new DirectoryEntry( ConfigurationManager.AppSettings["path"], ConfigurationManager.AppSettings["user"], ConfigurationManager.AppSet

    0熱度

    1回答

    我讀過下面的代碼是打擊WINNT用戶進行身份驗證的方式。我一直在嘗試在本地機器上驗證用戶身份。對於什麼都原因,root.NativeObject不會拋出一個異常我的本地用戶的密碼或用戶名是否正確。任何想法可能是什麼問題? try { using (var root = new DirectoryEntry("WinNT://" + _root, domainAndUsername, _

    0熱度

    1回答

    我試圖recive在我的廣告中的所有計算機,以及他們當中哪些whos當前登錄。我試着通過檢查「lastLogonStamp」但是返回錯誤的值,說我的服務器在八天前登錄到了AD。即使我重啓服務器,它也是如此。我從另一個問題在這裏代碼: How to list all computers and the last time they were logged onto in AD? public Dat

    0熱度

    1回答

    我使用下面的代碼來驗證屬於我們公司域的用戶。這工作正常。 using (var entry = new DirectoryEntry("")) { DirectorySearcher ds = new DirectorySearcher(entry); ds.Filter = "(|(&(objectCategory=user)(name=domainuser)))";

    1熱度

    1回答

    我一直在使用DirectoryServices命名空間中的DirectoryEntry對象,它一直很好。但是我修改了其中一個LDAP類,並突然停止了32位版本的程序工作。 我將ActiveDs引用導入到我的項目中,以便將ADSI對象轉換爲適當的類型。但從那時起,我的項目在創建DirectoryEntry對象實例時無法正確綁定。 我已經嘗試綁定與LDAP和WinNT提供程序,但無濟於事。我得到的錯誤

    -2熱度

    1回答

    我嘗試使用此代碼啓用Windows帳戶,但我在此行中的ObjectSecurity(空引用)中發生異常ActiveDirectorySecurity userSecurity = user.ObjectSecurity;

    0熱度

    3回答

    好了,所以我試圖從Active Directory用戶拉入一個DirectoryUser對象,如果我喜歡這種類型,它工作得很好: DirectoryEntry user = new DirectoryEntry(@"LDAP://CN=Name, OU=Department, OU=Group, DC=Domain1, DC=Domain2"); user.Properties["thumbna

    1熱度

    2回答

    我有一個代碼,可以獲取1000或使用DirectorySearcher的所有結果。 但我只想得到6000個結果中的2000個。 這裏是代碼即可獲得6000名成績,而我只想要2000 mySearcher.SizeLimit = 2000; mySearcher.PageSize = 1000; SearchResultCollection results = mySearcher.FindA