0

In a VSTO Add-In when invoking the UserPrincipal.Current.GivenName function, a timeout of 14s occurs and then the following error is generated:

"The specified domain does not exist or cannot be contacted."

The PC is under a firewall and it might be that some request are blocked but Fiddler does not show any error. Can someone tell me.

  1. What are the prerequisites for the function to work? Does the PC needs to be within the domain? Is there any network ports/protocols which need to be open? How does the function locates the LDAP service?
  2. Is there any way to inspect if the domain is available without suffering from the 14s timeout?

Investigations:

Salim
  • 495
  • 3
  • 20

1 Answers1

0

Fiddler is only for HTTP traffic. It won't show you all network traffic. You would need to use Wireshark for that.

What are the prerequisites for the function to work?

You just need to be logged in.

Does the PC needs to be within the domain?

If you're logged in with a domain account, UserPrincipal.Current will point to a domain account. If you're logged in with a local account, it will point to a local account.

Is there any network ports/protocols which need to be open?

By default, it will connect to the domain using TCP port 389.

How does the function locates the LDAP service?

If you are logged in with a domain account, then that means your computer is joined to either the same domain or a trusted domain. That means the computer knows the domain name and how to connect to it.

Is there any way to inspect if the domain is available without suffering from the 14s timeout?

You can use PowerShell to test the TCP connection:

Test-NetConnection -Port 389 example.com

Where example.com is the domain name.

Gabriel Luci
  • 38,328
  • 4
  • 55
  • 84