none
Monitoring Active Directory metrics - Win32_PerfFormattedData_NTDS_NTDS is missing.

    Pergunta

  • Hello,

    i want to Write a VBScript to retrieve several metrics that will allow monitoring of Active Directory activity, such as:

    DS Directory Read/Writes per second,

    Kerberos Authentcations,

    LDAP Successful Writes per second,

    and many more.

    The WMI Class - Win32_PerfFormattedData_NTDS_NTDS is supposed to have all the data that i need,

    but when trying to access it through vbscript, i get a null class error.

    I  have tried "Wmiadap /F" and have read many posts about this issue, but without any solution.

    I want to solve this issue - whether through creating the class somehow or any other class\vbscript way to retrieve the type of data

    that i have descrived above.

    Here is an example for the test script i used to check for access to the WMI Class:

    strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colDatabases = objWMIService.ExecQuery _ ("Select * from Win32_PerfFormattedData_NTDS_NTDS") For Each objADDatabase in colDatabases Wscript.Echo "DS threads in use: " & objADDatabase.DSThreadsInUse Wscript.Echo "LDAP bind time: " & objADDatabase.LDAPBindTime Wscript.Echo "LDAP client sessions: " & objADDatabase.LDAPClientSessions Next

    It failed with the error mentioned above.

    I ran the script on server 2003 sp1 OS, but it should be designed to work an 2008 server as well.

    Thank you.


    • Editado MOMER domingo, 19 de fevereiro de 2012 14:20
    domingo, 19 de fevereiro de 2012 14:11

Respostas

  • WMIADAP /r still doesn't cut it...

    doesn't work =\

    Are you sure those performance classes exist on WS2008?  Are you running this on a Doman COntroller.  These clases will not exist on a non-DC.

    I just ran this on WS2008 with no issues.  I find that the WS2003 DCs exhibit the issue noted in the KB and require a patch.


    ¯\_(ツ)_/¯

    • Sugerido como Resposta Bigteddy sábado, 25 de fevereiro de 2012 03:47
    • Marcado como Resposta Boe ProxMVP, Moderator quinta-feira, 1 de março de 2012 18:42
    sexta-feira, 24 de fevereiro de 2012 19:00

Todas as Respostas

  • Refer to the following link on using "wmiadap" to install those classes on your down-level servers:

    http://msdn.microsoft.com/en-us/library/windows/desktop/aa394528(v=vs.85).aspx

    Use:

    wmiadap /f


    Grant Ward, a.k.a. Bigteddy

    What's new in Powershell 3.0 (Technet Wiki)


    domingo, 19 de fevereiro de 2012 14:56
  • Is this example from the gallery closer to what you want?

    http://gallery.technet.microsoft.com/scriptcenter/edf4b104-5f62-408a-a220-89980b96c440

    Also, if the script raises errors on Windows Server 2003, can you verify whether it works on Windows Server 2008? And you can post a comment/question in the link above.


    Richard Mueller - MVP Directory Services

    domingo, 19 de fevereiro de 2012 17:08
  • Hi all.

    Big Teddy - i wrote in the first post that i used this command and it didn't help me.

    Richard - the script itself isn't the issue. The issue is that the Classes are missing and i can't create them, even by using wmiadap /F.

    I need the script to work for both 2003 and 2008, or atleast to try to achieve this.

    Thanks.


    terça-feira, 21 de fevereiro de 2012 09:50
  • Sorry, I missed that.  Just un-mark the question as answered.

    Grant Ward, a.k.a. Bigteddy

    What's new in Powershell 3.0 (Technet Wiki)


    • Editado Bigteddy terça-feira, 21 de fevereiro de 2012 10:03
    terça-feira, 21 de fevereiro de 2012 10:03
  •     WMIADAP /r

         /r

    Parses all the Windows Driver Model drivers on the system to create performance objects

    Not /F


    ¯\_(ツ)_/¯

    terça-feira, 21 de fevereiro de 2012 14:03
  • WMIADAP /r still doesn't cut it...

    doesn't work =\

    sexta-feira, 24 de fevereiro de 2012 15:36
  • WMIADAP /r still doesn't cut it...

    doesn't work =\

    Are you sure those performance classes exist on WS2008?  Are you running this on a Doman COntroller.  These clases will not exist on a non-DC.

    I just ran this on WS2008 with no issues.  I find that the WS2003 DCs exhibit the issue noted in the KB and require a patch.


    ¯\_(ツ)_/¯

    • Sugerido como Resposta Bigteddy sábado, 25 de fevereiro de 2012 03:47
    • Marcado como Resposta Boe ProxMVP, Moderator quinta-feira, 1 de março de 2012 18:42
    sexta-feira, 24 de fevereiro de 2012 19:00
  • Hey...

    i dunno about 2008, but i still have this problem on 2003 and couldn't find a patch to solve it. Triea all the WMIADAP switches and still didn't work.

    Do you know which patch can help? didn't find the appropriate KB..

    domingo, 11 de março de 2012 13:43
  • Hey...

    i dunno about 2008, but i still have this problem on 2003 and couldn't find a patch to solve it. Triea all the WMIADAP switches and still didn't work.

    Do you know which patch can help? didn't find the appropriate KB..

    Start by installing the couters with this script:

    ' This must be run on a WS2003 Domain Controller
    With WScript.CreateObject("WScript.Shell")
    .RegWrite "HKLM\System\CurrentControlSet\Services\Esent\Performance\Open", "OpenPerformanceData", "REG_SZ"
    .RegWrite "HKLM\System\CurrentControlSet\Services\Esent\Performance\Collect", "CollectPerformanceData", "REG_SZ"
    .RegWrite "HKLM\System\CurrentControlSet\Services\Esent\Performance\Close", "ClosePerformanceData", "REG_SZ"
    .RegWrite "HKLM\System\CurrentControlSet\Services\Esent\Performance\Library", "C:\windows\system32\esentprf.dll", "REG_SZ"
    .Run "%comspec% /c lodctr.exe c:\windows\system32\esentprf.ini"
    End With
    WScript.Echo "Reboot system to activate counters"


    ¯\_(ツ)_/¯

    domingo, 11 de março de 2012 18:06
  • You can also just use teh lodctr directly if you jsut want to chaeck the install.

    cd %windir%\system32
    lodctr.exe ntdsctrs.ini

    Here is a link to the hotfix if the counter fails with 0x80041010,

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

    Follow the instructions very carefully.


    ¯\_(ツ)_/¯

    domingo, 11 de março de 2012 18:35