Monitoring Active Directory metrics - Win32_PerfFormattedData_NTDS_NTDS is missing.

Yanıt Monitoring Active Directory metrics - Win32_PerfFormattedData_NTDS_NTDS is missing.

  • 19 Şubat 2012 Pazar 14:11
     
      Kod İçerir

    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.


    • Düzenleyen MOMER 19 Şubat 2012 Pazar 14:20
    •  

Tüm Yanıtlar

  • 19 Şubat 2012 Pazar 14:56
     
     Önerilen Yanıt

    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)


  • 19 Şubat 2012 Pazar 17:08
    Moderatör
     
     

    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

  • 21 Şubat 2012 Salı 09:50
     
     

    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.


  • 21 Şubat 2012 Salı 10:03
     
     
    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)


  • 21 Şubat 2012 Salı 14:03
     
     Önerilen Yanıt

        WMIADAP /r

         /r

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

    Not /F


    ¯\_(ツ)_/¯

  • 24 Şubat 2012 Cuma 15:36
     
     

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

    doesn't work =\

  • 24 Şubat 2012 Cuma 19:00
     
     Yanıt

    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.


    ¯\_(ツ)_/¯

  • 11 Mart 2012 Pazar 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..

  • 11 Mart 2012 Pazar 18:06
     
      Kod İçerir

    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"


    ¯\_(ツ)_/¯

  • 11 Mart 2012 Pazar 18:35
     
     

    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.


    ¯\_(ツ)_/¯