G
Guest
What is the control in vb.net to see if the user have the password set to
expire....It must be a filter or something like this...thanks a lot!
My code is the following for now....
Dim strDomain As String
Dim objDomainName As Object
Dim rootds As New DirectoryEntry("LDAP://rootDSE")
strDomain = rootds.Properties("DefaultNamingContext")(0)
Dim root As New System.DirectoryServices.DirectoryEntry("LDAP://" &
strDomain)
Dim searcher As New System.DirectoryServices.DirectorySearcher(root)
searcher.Filter = "(&(objectCategory=user))"
searcher.PropertiesToLoad.Add("cn")
Dim results As SearchResultCollection
results = searcher.FindAll()
Dim result As SearchResult
For Each result In results
Dim User As New
System.DirectoryServices.DirectoryEntry(result.Path)
MsgBox(User.Properties("cn").Item(0)) ' display a message box
for each match
User = Nothing
Next result
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
expire....It must be a filter or something like this...thanks a lot!
My code is the following for now....
Dim strDomain As String
Dim objDomainName As Object
Dim rootds As New DirectoryEntry("LDAP://rootDSE")
strDomain = rootds.Properties("DefaultNamingContext")(0)
Dim root As New System.DirectoryServices.DirectoryEntry("LDAP://" &
strDomain)
Dim searcher As New System.DirectoryServices.DirectorySearcher(root)
searcher.Filter = "(&(objectCategory=user))"
searcher.PropertiesToLoad.Add("cn")
Dim results As SearchResultCollection
results = searcher.FindAll()
Dim result As SearchResult
For Each result In results
Dim User As New
System.DirectoryServices.DirectoryEntry(result.Path)
MsgBox(User.Properties("cn").Item(0)) ' display a message box
for each match
User = Nothing
Next result
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try