Vb.net Ad Password never expires

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top