Query RootDSE using DotNET (Visual Basic)

This code can be found in Chapter 20 of Active Directory Cookbook, 2nd edition

Purchase XP Cookbook or Networking Recipes for only $25 plus shipping! While supplies last.

Find out how to download all of the Visual Basic code from this site.

Imports System.DirectoryServices

Module Module1

    Sub Main()

        Dim objRootDSE As New DirectoryEntry("LDAP://RootDSE")

        Dim strAttrName As String
        Dim objValue As Object

        For Each strAttrName In objRootDSE.Properties.PropertyNames
            For Each objValue In objRootDSE.Properties(strAttrName)
                Console.WriteLine(strAttrName & " : " & objValue.ToString)
            Next objValue
        Next strAttrName

    End Sub

End Module

This code has been viewed 3281 times.

New from the creators of TechTasks.com: StatSheet.com