Monitoring Active Directory metrics - Win32_PerfFormattedData_NTDS_NTDS is missing.
-
2012年2月19日 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.
- 已编辑 MOMER 2012年2月19日 14:20
全部回复
-
2012年2月19日 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)
- 已编辑 BigteddyMicrosoft Community Contributor 2012年2月19日 14:58
- 已建议为答案 Rich PrescottModerator 2012年2月19日 17:43
- 已标记为答案 IamMredMicrosoft Employee, Owner 2012年2月20日 5:28
- 取消答案标记 MOMER 2012年2月22日 17:41
-
2012年2月19日 17:08版主
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
- 已标记为答案 IamMredMicrosoft Employee, Owner 2012年2月20日 5:28
- 取消答案标记 MOMER 2012年2月22日 17:41
-
2012年2月21日 9: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.
-
2012年2月21日 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)
- 已编辑 BigteddyMicrosoft Community Contributor 2012年2月21日 10:03
-
2012年2月21日 14:03
WMIADAP /r
/r
Parses all the Windows Driver Model drivers on the system to create performance objects
Not /F
¯\_(ツ)_/¯
- 已建议为答案 Richard MuellerMVP, Moderator 2012年2月21日 14:54
- 已标记为答案 IamMredMicrosoft Employee, Owner 2012年2月24日 12:28
- 取消答案标记 MOMER 2012年2月24日 15:35
-
2012年2月24日 15:36
WMIADAP /r still doesn't cut it...
doesn't work =\
-
2012年2月24日 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.
¯\_(ツ)_/¯
- 已建议为答案 BigteddyMicrosoft Community Contributor 2012年2月25日 3:47
- 已标记为答案 Boe ProxModerator 2012年3月1日 18:42
-
2012年3月11日 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..
-
2012年3月11日 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"
¯\_(ツ)_/¯
-
2012年3月11日 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.
¯\_(ツ)_/¯

