Search This Blog
Wednesday, September 30, 2009
Tuesday, September 29, 2009
Monday, September 28, 2009
Anonymous access in server 2008 IIS
goto Default Website -> Authentication -> Anonymous Authentication (set enable/disable)
System.DirectoryServices.DirectoryServicesCOMException: Logon failure: unknown user name or bad password.
http://stackoverflow.com/questions/400872/c-active-directory-check-username-password
Resolved my issue by using "Imports System.DirectoryServices.AccountManagement"
Project was working well in XP but not in Windows 7
Replaced:
Dim domainEntry As DirectoryServices.DirectoryEntry
Dim searcher As DirectoryServices.DirectorySearcher
Dim results As DirectoryServices.SearchResultCollection
Dim domainLogin As String
Dim fullName As String
domainLogin = User.Identity.Name
'Strip off domain prefix
domainLogin = domainLogin.Substring(domainLogin.IndexOf("\") + 1, domainLogin.Length - domainLogin.IndexOf("\") - 1)
domainEntry = New DirectoryServices.DirectoryEntry("LDAP://domainname.com", "domainname\username", "Password")
searcher = New DirectoryServices.DirectorySearcher(domainEntry, "(SAMAccountname=" + domainLogin + ")")
results = searcher.FindAll()
with:
Dim domainEntry As DirectoryServices.DirectoryEntry
Dim searcher As DirectoryServices.DirectorySearcher
Dim results As DirectoryServices.SearchResultCollection
Dim domainLogin As String
Dim fullName As String
domainLogin = User.Identity.Name
'Strip off domain prefix
domainLogin = domainLogin.Substring(domainLogin.IndexOf("\") + 1, domainLogin.Length - domainLogin.IndexOf("\") - 1)
Dim context As PrincipalContext = New PrincipalContext(ContextType.Domain)
Dim foundUser As UserPrincipal = UserPrincipal.FindByIdentity(context, "username")
domainEntry = CType(foundUser.GetUnderlyingObject(), DirectoryEntry)
searcher = New DirectoryServices.DirectorySearcher(domainEntry, "(SAMAccountname=" + domainLogin + ")")
results = searcher.FindAll()
Friday, September 25, 2009
SharePoint WildCard Search
http://nullexception.net/2009/03/sharepoint-2007-wildcard-search/
http://www.codeplex.com/SPWildCardSearch - it is a web part that allows for WildCard Searches
http://kmpipeline.blogspot.com/2007/05/free-moss-wild-card-search-add-on.html - Ontalica add on for wild card search (FREE)
Subscribe to:
Posts (Atom)