I found a workaround:
##############################
Domain dmn = Domain.GetCurrentDomain();
DirectoryContext ctx = new DirectoryContext(DirectoryContextType.Domain,
dmn.Name);
DomainControllerCollection dcc = DomainController.FindAll(ctx);
foreach(DomainController dc in dcc)
{
DirectorySearcher ds;
using (ds = dc.GetDirectorySearcher())
{
ds.Filter = String.Format("(email=" + emailAcc + ")");
}
SearchResult sr = ds.FindOne();
ResultPropertyCollection rpc = sr.Properties;
foreach(string prop in rpc.PropertyNames)
{
foreach(Object obj in rpc[prop])
{
if (prop.ToLower() == "mailnickname")
{
userName = obj.ToString();
}
}
}
}
....
#################################
This works on my development environment. However when I port this over to
my production environment, I receive the following error:
"The server is not operational"
@ line 'SearchResult sr = ds.FindOne();'
I tried with FindAll(), but receive the same error.
Is there an explanation or solution for this?