|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
search in ADHow Can I do for search a computer in my Active Directory with vb .net?
Thanks On Thu, 23 Nov 2006 09:16:01 -0800, sgr <s**@discussions.microsoft.com> wrote:
¤ How Can I do for search a computer in my Active Directory with vb .net? You can use the System.DirectoryServices namespace: Dim RootDSE As New DirectoryServices.DirectoryEntry("LDAP://RootDSE") Dim DomainDN As String = RootDSE.Properties("DefaultNamingContext").Value Dim ADEntry As New DirectoryServices.DirectoryEntry("LDAP://" & DomainDN) Dim ADSearch As New System.DirectoryServices.DirectorySearcher(ADEntry) ADSearch.Filter = ("(&(objectClass=computer)(name=computername))") ADSearch.SearchScope = SearchScope.Subtree Dim ComputerFound As SearchResult = ADSearch.FindOne() If Not IsNothing(ComputerFound) Then MsgBox("Computer was found!") Else MsgBox("Computer was not found.") End If Paul ~~~~ Microsoft MVP (Visual Basic)
Upgrade Question
Q: Regular Expressions? tell more about .net framework date time picker and validate event ( is this a bug ? ) Managing without .NET for runtime applications Drag and drop multiple button controls..need help modifying code please??? Automatic Form Fill in SQL connection problem Inherited handler problem. Looking For Training Recommendations |
|||||||||||||||||||||||