Get AD Schema Version

Discussion in 'Scripting' started by Jesper Ravn, Oct 28, 2009.

  1. Jesper Ravn

    Jesper Ravn Guest

    Hello

    How can I retrive the AD Schema Version from pure VBS or VB.net.
    Ex. Windows 2008 = 44 or Windows 2008 R2 = 47.

    Thanks,

    /Jesper
     
    Jesper Ravn, Oct 28, 2009
    #1
    1. Advertisements

  2. This link should help:

    http://support.microsoft.com/kb/556086

    In VBScript:
    =======
    Option Explicit
    Dim objRootDSE, strSchema, objSchema

    ' Determine DNS domain name.
    Set objRootDSE = GetObject("LDAP://RootDSE")
    strSchema = objRootDSE.Get("schemaNamingContext")

    Set objSchema = GetObject("LDAP://" & strSchema)
    Wscript.Echo "Schema Version: " & objSchema.objectVersion
     
    Richard Mueller [MVP], Oct 28, 2009
    #2
    1. Advertisements

  3. Jesper Ravn

    Jesper Ravn Guest

    Hi Richard

    Thanks a lot, it's working.
    Case closed :)

    /Jesper
     
    Jesper Ravn, Oct 28, 2009
    #3
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.