directoryservices

How can I get the local group name for guests/administrators?

让人想犯罪 __ 提交于 2019-11-30 06:44:37
Question: I use the code found at http://support.microsoft.com/kb/306273 to add a windows user. The problem is i need to add the user to a group, but the groupnames are localized. E.g. the MS-example uses an english computer, which means you can get the guest group like this: grp = AD.Children.Find("Guests", "group") But on a non-english computer, the 'Guest' groupname is localized, meaning for example on my german language OS, the group name for Guests is "Gäste". Which means for the support example to run on my computer i need to change that line to grp = AD.Children.Find("Gäste", "group")

Major Active Exception while accessing creating user : Exception 0000202B: RefErr: DSID-031007EF, data 0, 1 access points" [extended Error 8235]

折月煮酒 提交于 2019-11-30 05:17:37
问题 I need to read the Active Directory, search users and create user functionality. I am able to use DirectoryEntry in C# and Domain is only physical server. In my production environment, I have two physical domain servers with same domain name. When I try to search the AD user or create, I am getting the following exception. Exception : "0000202B: RefErr: DSID-031007EF, data 0, 1 access points" [extended Error 8235] Note that I have Domain Admin privileges on the domain but I'm still having the

GroupPrincipal.GetMembers fails when group (or child group if recursive) contains ForeignSecurityPrincipal

雨燕双飞 提交于 2019-11-30 02:39:12
问题 This is not so much a question as information for anyone experiencing the same problem. The following error occurs: System.DirectoryServices.AccountManagement.PrincipalOperationException: An error (87) occurred while enumerating the groups. The group's SID could not be resolved. at System.DirectoryServices.AccountManagement.SidList.TranslateSids(String target, IntPtr[] pSids) at System.DirectoryServices.AccountManagement.SidList.ctor(List`1 sidListByteFormat, String target, NetCred

How to determine all the groups a user belongs to (including nested groups) in ActiveDirectory and .NET 3.5

可紊 提交于 2019-11-30 01:42:35
I have an application that uses ActiveDirecotry authorisation and it has been decided that it needs to support nested AD groups, e.g.: MAIN_AD_GROUP | |-> SUB_GROUP | |-> User So, the user in not directly a member of MAIN_AD_GROUP . I'd like to be able to look for the user recursively, searching the groups nested in MAIN_AD_GROUP . The main problem is that I'm using .NET 3.5 and there is a bug in System.DirectoryServices.AccountManagement in .NET 3.5 whereby the method UserPrincipal.IsMemberOf() will not work for groups with more than 1500 users . So I can't use UserPrincipal.IsMemberOf() and

Connecting to LDAP Server from .NET

不想你离开。 提交于 2019-11-29 22:54:14
问题 I've been recommended to use System.DirectoryServices.Protocols to be able to support connecting to LDAP servers other than Active Directoy here. Unfortunately, I have not been able to search the directory properly. I'd like to be able to get a certain attribute for a user (e.g. mail ). This is easily done in System.DirectoryServices namespace by using DirectorySearcher class. How can I achieve the same in System.DirectoryServices.Protocols namespace. Here's what I have so far: var

If an OU contains 3000 users, how to use DirectorySearcher to find all of them?

◇◆丶佛笑我妖孽 提交于 2019-11-29 14:17:46
问题 I use this code: DirectoryEntry objEntry; DirectorySearcher objSearchEntry; SearchResultCollection objSearchResult; string strFilter = "(&(objectCategory=User))"; objEntry = new DirectoryEntry(conOUPath, conUser, conPwd, AuthenticationTypes.Secure); objEntry.RefreshCache(); objSearchEntry = new DirectorySearcher(objEntry); objSearchEntry.Filter=strFilter; objSearchEntry.SearchScope=SearchScope.Subtree; objSearchEntry.CacheResults=false; objSearchResult=objSearchEntry.FindAll(); Each time, it

DirectoryServicesCOMException 80072020 From IIS 7.5 Site Running Under ApplicationPoolIdentity

冷暖自知 提交于 2019-11-29 14:02:54
I'm having trouble hunting down an issue where an ASP.NET 4 application fails while trying to get user groups for a given user from time to time. The application pool associated with this application is setup to run under ApplicationPoolIdentity. Exception Info System.DirectoryServices.DirectoryServicesCOMException HRESULT: 80072020 Message: An operations error occurred. Extended Message: 000004DC: LdapErr: DSID-0C0906E8, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v1db1 Stack Trace System.DirectoryServices.DirectoryEntry.Bind

Where is the domain name in a UserPrincipal object?

杀马特。学长 韩版系。学妹 提交于 2019-11-29 14:00:37
问题 I'm using the System.DirectoryServices.ActiveDirectory classes to find all Active Directory users. The code is very simple: var context = new PrincipalContext(ContextType.Domain); var searcher = new PrincipalSearcher(new UserPrincipal(context)); var results = searcher.FindAll(); I want to get the domain-qualified username in the "friendly" (aka. "pre-Windows 2000" format), eg. "CONTOSO\SmithJ". UserPrincipal.SamAccountName gives me the username part, but how do I get the domain part? I cannot

Strange issue with System.DirectoryServices.AccountManagement.UserPrincipal.FindByIdentity

白昼怎懂夜的黑 提交于 2019-11-29 02:48:26
问题 We're writing a system that allows a user to change their account password through a web application on our intranet. At first, everything appeared to be running smoothly. During development passwords for our test accounts could be changed with no problem. When we made the system live, however, we started running into issues. Here are the symptoms: At first, everything is fine. Users can change their passwords. At some point, the following error occurs in UserPrincipal.FindByIdentity: "System

System.DirectoryServices - The server is not operational

假如想象 提交于 2019-11-28 22:14:36
问题 I get an error by a website, on which I use Windows Authentication. Strange things: Only occurs if user is not yet saved into database (new unknown user) Appears only on live system, everything fine on local development environment This is what I get in a logging mail: Source : System.DirectoryServices Message: The server is not operational. Trace: at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) at System.DirectoryServices.DirectoryEntry.Bind() at System.DirectoryServices