(This is a question about a vague problem. I try to present all relevant data, in the hope that someone has helpful information; apologies for the long description.) Our web app We have a .NET 4 web application running in IIS 7.5 accessing Active Directory and a SQL Server database. [...] read more
I got the following snippet (SomeName/SomeDomain contains real values in my code) var entry = new DirectoryEntry("LDAP://CN=SomeName,OU=All Groups,dc=SomeDomain,dc=com"); foreach (object property in entry.Properties) { Console.WriteLine(property); } It prints OK for the first 21 properties, but then fail with: COMException {"Unknown error (0x8000500c)"} at System.DirectoryServices.PropertyValueCollection.PopulateList() at System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry entry, String propertyName) at [...] read more
When trying to find an User on a LDAP Server, I get the following error "Unknown error (0x8000500c)" This is the code I'm using: PrincipalContext domainContext = new PrincipalContext(ContextType.Domain, "gandalf.intrafg"); UserPrincipal p = UserPrincipal.FindByIdentity(domainContext, IdentityType.SamAccountName, "Consultor1"); Indidentally, the following piece of code seems to work (no exception is generated), but [...] read more
I'm trying to build a feature to my .Net application to be able to talk to an LDAP server to read user attributes and authenticate users. I have setup a test directory server using OpenDS, added custom attributes and objects, and added users with the new object types. Everything works [...] read more
I have a custom LDAP schema installed on my OpenLDAP server which is as follows: attributeType ( 999.0.01 NAME 'picturePath' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} ) objectClass ( 999.1.01 NAME 'indieStackTeam' DESC 'Team definition for IndieStack' SUP groupOfUniqueNames STRUCTURAL MAY ( picturePath ) ) In my ASP.NET MVC 2 [...] read more
When deploying this code to a web application where the identity is the app pool user the following code throws an unknown COM exception. The exception is happening when the FindByIdentity method is invoked. > System.Runtime.InteropServices.COMException: Unknown error (0x8000500c) using (PrincipalContext prinCon = new PrincipalContext(ContextType.Domain)) { GroupPrincipal groupPrin = GroupPrincipal.FindByIdentity(prinCon, [...] read more
Below is a code in C# where I am trying to add SSL binding of an existing certificate to "Default Website" in IIS Server. But I keep getting > System.Runtime.InteropServices.COMException (0x8000500C) in statement > "website.Properties["SSLCertHash"].Add(x509.GetCertHash());". Do you know the reason why? string defaultWebsite = "Default Web Site"; foreach (DirectoryEntry website [...] read more
I am running a WCF(.NET 3.5) service on IIS 7 in "domain1". The service runs under a domain user account from trusted domain "domain 2". The service is running on a different machine(virtual machine) from the machine(virtual machine) where "domain1" Domain Controller is running. The service was working properly in [...] read more
Strange things happen... I was forced to move to a new developer machine (Windows Server 2008 R2 to 2012). The exact same code doesn't work on the new machine. public override MembershipUserCollection FindUsersByEmail(string emailToMatch, int pageIndex, int pageSize, out int totalRecords) { MembershipUserCollection retvalue = new MembershipUserCollection(); string ldapConnectionString = [...] read more
I am trying to read an attribute from an LDAP (not AD) entry using C# and the .NET library 'System.DirectoryServices'. My LDAP entry is the following: dn: uid=foo,ou=People,dc=companyname,dc=local objectClass: posixAccount objectClass: top objectClass: inetOrgPerson objectClass: organizationalPerson objectClass: person gidNumber: 0 givenName: Foo sn: Bar displayName: Foo Bar uid: foo homeDirectory: [...] read more
I have this class LDAP which gets users from AD. It works locally, but when I deploy on a remote server I get Unknown error (0x8000500c). As from stack trace on remote machine I presume that error is thrown while invoking GetUsers() library method: [COMException (0x8000500c): Unknown error (0x8000500c)] Library.LDAP..ctor(String [...] read more
I am trying to enumerate the values in a SearchResultCollection. Everything compiles fine, but I get the 0x8000500c error on this line: foreach (PropertyValueCollection e in de.Properties.Values) { sw.WriteLine(e.Value); } Full method is below: private static void GetValues() { var directoryEntry = new DirectoryEntry("LDAP://8.8.8.8:8888", "foo", "bar", AuthenticationTypes.None); var ds = [...] read more
We have an application that is built around Active Directory for it's authentication, and are trying to implement at a client that uses Novell eDirectory (or NetIQ now, I guess.) They have installed a feature call Domain Services for Windows which, according to it's white paper, should simulate Active Directory [...] read more
I've searching for a solution to my problem for a couple days now and have found almost nothing. Here's the issue: I need to attach an SSL certificate to a website in IIS 6. I can set the https binding but every time I try to set the certificate's thumbprint, [...] read more
I have an ASP.NET application which calls out to a WCF service for all its data access and business logic needs. App -> WCF -> DB etc. The application is hosted in IIS with a custom user as the ApplicationPoolIdentity. ASP Impersonation is enabled for the web application. The ApplicationPoolIdentity [...] read more
Ok, I have Active Directory lookups working fine when a user enters their user pass. Now I am trying to adapt that code to allow for single sign-on. What I have: * IIS App Pool set to Network User * Anonymous Auth turned off in IIS * web config setup [...] read more
I have a small script to query a LDAP server $domain = "LDAP://server-url:389/dc=dir,dc=cx,dc=com" $auth = [System.DirectoryServices.AuthenticationTypes]::FastBind $root = New-Object System.DirectoryServices.DirectoryEntry($domain, $Username, $Password, $auth) $query = new-Object System.DirectoryServices.DirectorySearcher($root) $query.Filter = "uid=myuser" $objClass = $query.FindOne() if (($objClass -eq $null) -or ($objClass.Count -eq 0)) { write-Host "UID=myuser does not exist" } else { [...] read more
A added a custom attribute to the Active Directory Schema. On one machine when I try to query the attribute I get errors back from my code. Here is the C# version to test this out. static class Program { static void Main() { Console.ReadLine(); DirectoryEntry directoryEntry = (DirectoryEntry)UserPrincipal.Current.GetUnderlyingObject(); //Execption [...] read more