Monitoring Active Directory metrics - Win32_PerfFormattedData_NTDS_NTDS is missing.
-
19 februarie 2012 14:11
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.
- Editat de MOMER 19 februarie 2012 14:20
Toate mesajele
-
19 februarie 2012 14:56
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)
- Editat de BigteddyMicrosoft Community Contributor 19 februarie 2012 14:58
- Propus ca răspuns de Rich PrescottModerator 19 februarie 2012 17:43
- Marcat ca răspuns de IamMredMicrosoft Employee, Owner 20 februarie 2012 05:28
- Anulare marcare ca răspuns de MOMER 22 februarie 2012 17:41
-
19 februarie 2012 17:08Moderator
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
- Marcat ca răspuns de IamMredMicrosoft Employee, Owner 20 februarie 2012 05:28
- Anulare marcare ca răspuns de MOMER 22 februarie 2012 17:41
-
21 februarie 2012 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 februarie 2012 10:03Sorry, 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)
- Editat de BigteddyMicrosoft Community Contributor 21 februarie 2012 10:03
-
21 februarie 2012 14:03
WMIADAP /r
/r
Parses all the Windows Driver Model drivers on the system to create performance objects
Not /F
¯\_(ツ)_/¯
- Propus ca răspuns de Richard MuellerMVP, Moderator 21 februarie 2012 14:54
- Marcat ca răspuns de IamMredMicrosoft Employee, Owner 24 februarie 2012 12:28
- Anulare marcare ca răspuns de MOMER 24 februarie 2012 15:35
-
24 februarie 2012 15:36
WMIADAP /r still doesn't cut it...
doesn't work =\
-
24 februarie 2012 19:00
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.
¯\_(ツ)_/¯
- Propus ca răspuns de BigteddyMicrosoft Community Contributor 25 februarie 2012 03:47
- Marcat ca răspuns de Boe ProxModerator 1 martie 2012 18:42
-
11 martie 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..
-
11 martie 2012 18:06
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 martie 2012 18:35
You can also just use teh lodctr directly if you jsut want to chaeck the install.
cd %windir%\system32
lodctr.exe ntdsctrs.iniHere is a link to the hotfix if the counter fails with 0x80041010,
http://support.microsoft.com/kb/941084
Follow the instructions very carefully.
¯\_(ツ)_/¯