Last post May 18, 2008 04:16 PM by johram
May 13, 2008 08:11 AM|tutus|LINK
My colleague uses DirectoryEntry class to get the list of users that belong to domain group.
Often, the code works on the local developement machine with no problem.
But, when we deploy the web site on the web server. Sometimes the code works and sometimes doe not work. If we inspect the members when the code fails, the properties, like : givenName, firstName, samuseraccount return nothing.
Are you aware what might cause the directory info members to return nothing after it works for a while, or the opposit, meaning, it doesn t work first, and all of a sudden, it starts working.
We tried both, using network serrvice account and a custom account.
This is gonna drive us crazy :)
May 13, 2008 03:06 PM|tutus|LINK
Sorry Guys, I meant DirectoryEntry and not DirectoryInfo.
May 18, 2008 04:16 PM|johram|LINK
Please read through Ryan Dunn's Common System.DirectoryServices Issues and Solutions. It is vital that you understand the difference in running the web from Visual Studio as opposed to running it in IIS.
The only way to get the same behavior in both scenarios is to make sure you use explicit credentials. And make sure you're using the *same* credentials! If you read the article, it will give you some hints on how to do this. Good luck!