AD Provider logging increase given duplicate account issues

This commit is contained in:
robvde 2013-01-26 09:50:58 +04:00
parent 1d2f80f24a
commit 932e77c770
4 changed files with 19 additions and 10 deletions

View file

@ -719,13 +719,14 @@ namespace WebsitePanel.Providers.HostedSolution
private bool DoesSamAccountNameExistInternal(string accountName)
{
HostedSolutionLog.LogStart("DoesSamAccountNameExistInternal");
HostedSolutionLog.DebugInfo("userPrincipalName : {0}", accountName);
HostedSolutionLog.DebugInfo("sAMAccountName : {0}", accountName);
bool bFound = false;
try
{
string path = GetRootOU();
HostedSolutionLog.DebugInfo("Search path : {0}", path);
DirectoryEntry entry = ActiveDirectoryUtils.GetADObject(path);
DirectorySearcher searcher = new DirectorySearcher(entry);
@ -737,16 +738,17 @@ namespace WebsitePanel.Providers.HostedSolution
if (resCollection != null)
{
if (resCollection.Properties["samaccountname"] != null)
bFound = true; ;
bFound = true;
}
HostedSolutionLog.LogEnd("GetSamAccountNameByUserPrincipalNameInternal");
}
catch (Exception e)
{
HostedSolutionLog.DebugInfo("Failed : {0}", e.Message);
}
HostedSolutionLog.DebugInfo("DoesSamAccountNameExistInternal Result: {0}", bFound);
HostedSolutionLog.LogEnd("DoesSamAccountNameExistInternal");
return bFound;
}