locked
Getting a LDAP_ALREADY_EXISTS error when using OpenSCManager() RRS feed

  • Question

  • For some reason this forum software is not registering my paragraph breaks. In my C Program, I am trying to check the machines in my domain to see if they have a service active. To do this, I am using Active Directory to search for all the machines (successful) and then calling OpenSCManager(machineName, NULL, SC_MANAGER_ENUMERATE_SERVICE). Some of the machines return successful from that call, most don't however. They return with the LDAP_ALREADY_EXISTS error. I have no idea why that error is being returned since I am only asking for the handle to an already open SCM. The machines that return successfully are all in one OU in AD. That OU also contains two nested OU's in which the machines in there return that error. The rest of the machines are in an OU on the same level as the working OU. So, it sounds like a permissions issue since it's working in one of the OUs. However, the error implies that it isn't. I would think OpenSCManager() would return an permissions error if so. I also had my Network Admin log into a PC using his account and the same machines failed when I ran it from there. I am completely stuck and I've searched high and low on the intertubes for an answer.
    • Moved by Jesse Jiang Thursday, January 20, 2011 7:34 AM (From:Visual C++ General)
    Tuesday, January 18, 2011 11:44 PM

All replies