On 12 Oct, 11:31, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
<teeja...@gmail.comwrote in message
news:11**********************@e34g2000pro.googlegr oups.com...
I have added the reference to the project.
i get the following error
Server Error in '/StripNET' Application.
Then there's either a bug in your code somewhere, or you're not using
Windows 2003...
Presumably your code looks something like this:http://en.csharp-online.net/User_Man..._Directory%E2%...
How are you actually referencing the User object...?
--
Mark Rae
ASP.NET MVPhttp://www.markrae.net
No, the code works fine. It works fine on my PC which is running
IIS. Even if I am browsing to it out of VS. But if any other user
tried to use it on their machine it throws up the error. If i remove
this code that checks if the account is locked out then other users
don't receive the error.
my code is as follows:-
imports system.directoryservices
' some code above here which is not causing the problem.
Dim objUser As New DirectoryEntry("LDAP://" & strLDAP)
Dim objSearcher As DirectorySearcher = New
DirectorySearcher(objUser)
Dim objResults As SearchResultCollection
Dim objResult As SearchResult
Const lockoutFlag As Integer = 16
objSearcher.PropertiesToLoad.Add("msds-User-Account-Control-
Computed")
objResults = objSearcher.FindAll()
For Each objResult In objResults
Dim status As Integer =
DirectCast(objResult.Properties("msds-User-Account-Control-Computed")
(0), Integer)
If (status And lockoutFlag) = lockoutFlag Then
IsAccountLocked = True
Session("LDAP") = strLDAP
Else
IsAccountLocked = False
End If
Next
objUser.Close()
objUser.Dispose()
thanks for your help by the way. I really appreciate it!