简体   繁体   中英

User Authentication in Active Directory - Windows Server 2012 R2

We have a situation with Active Directory during project startup:

Environment Information: Central server that has the Main Active Directory server : Windows server 2012 R2 64-bit, IP Address: 192.168.1.10

Office server that has a read only Active Directory server: Windows server 2012 R2 64-bit, IP Address: 192.168.50.10 (this Active directory replicates users & workstations information from the central server). The two server are connected via a DSL network.

Our C# application runs on the office network and the Operator PC (Windows 7 64-bit) is joined to the domain in the office. it has to authenticate users from Active Directory in the Office Server using the following code.

 using (PrincipalContext pc = new PrincipalContext(ContextType.Domain, "mydomain.com"))
                    {
                        // validate the credentials
                        bool isValid = pc.ValidateCredentials("username", "password");
                        Log("Create principal context done");
                    }

The problem is we have the following errors that appear almost every time we try to run this code:

  1. The server is not operational
  2. The server could not be contacted
  3. The LDAP server is unavailable

In case this code works it take about 1 minutes to finish. Note: this code never fail in our development environment (LAN network with the same IP range 10.0.0. ).

Any suggestions?

Do you have any firewall or DNS issues?

Are you sure you are calling the correct server?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM