Windows error 0x8000500C, -2147463156

Detailed Error Information

HRESULT analysis[1]

FlagsSeverityFailure
Reserved (R)false
OriginMicrosoft
NTSTATUSfalse
Reserved (X)false
FacilityCode0 (0x000)
NameFACILITY_NULL[1][2]
DescriptionThe default facility code.[1][2]
Error Code20492 (0x500c)

Questions

59votes
3answers

IIS application using application pool identity loses primary token?

(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
asp.net
active-directory
iis-7.5
adsi
applicationpoolidentity
6votes
5answers

ActiveDirectory error 0x8000500c when traversing properties

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
c#
active-directory
directoryservices
3votes
2answers

How to find an user on a LDAP server

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
c#
ldap
3votes
2answers

.net ldap opends reading custom attributes 0x8000500c

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
c#
.net
ldap
opends
3votes
2answers

Querying custom LDAP property via System.DirectoryServices in C#?

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
c#
asp.net
.net
ldap
openldap
2votes
2answers

GroupPrincipal.FindByIdentity Unknown COM Exception

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
c#
active-directory
2votes
1answer

System.Runtime.InteropServices.COMException (0x8000500C) occuring while committing changes to DirectoryEntry in .Net

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
c#
.net
ssl
https
iis-8
1vote
0answers

Suddenly "Unknown error (0x8000500c)" is thrown when accessing Active Directory

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
c#
wcf
active-directory
1vote
2answers

edirectory read custom property value Unknown error (0x8000500c)

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
directoryservices
edirectory
1vote
1answer

LDAP error (0x8000500c) when accessing SOME attributes through C# code with administrator credentials

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
c#
.net
ldap
directoryservices
1vote
1answer

LDAP: Unknown error (0x8000500c) on server, locally working

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
iis
deployment
active-directory
1vote
1answer

Why am I getting a 0x8000500c error when enumerating a SearchResultCollection in .Net

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
.net
directory
enumeration
0votes
0answers

Using System.DirectoryServices.AccountManagement with Novell Domain Services for Windows

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
c#
edirectory
0votes
1answer

Attach SSL certificate to site in IIS programmatically

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
vb.net
ssl-certificate
iis-6
0votes
1answer

System.DirectoryServices.DirectoryServicesCOMException (0x8000500C) When Checking Group Membership

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
c#
asp.net
active-directory
0votes
1answer

C# Active Directory FindByIdentity Fails

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
c#
iis
active-directory
0votes
0answers

Exception for some users during LDAP query

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
powershell
ldap
0votes
1answer

Active Directory custom attribute can not be seen by it's owner on some computers

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
c#
active-directory

Comments

Leave a comment

(plain text only)

Sources

  1. https://msdn.microsoft.com/en-us/library/cc231198.aspx
  2. winerror.h from Windows SDK 10.0.14393.0

User contributions licensed under CC BY-SA 3.0