after having some trouble on my workstation with Acronis backup software, it seems that the root problem is somewhere inside WMI. Microsoft has created the WMIDiag tool to check all aspects of WMI and log the results in a large file. Unfortunately, it won't run "as is" on any OS newer than Vista SP1.
I found a hack though to enable the script to run on my Windows 7 Ultimate x64. In case you need the tool, you might find this helpful.
What you need
WMIDiag self-extracting archive (download here)
a text editor that is capable of showing line numbers, Notepad++ is a nice and free tool for this
Steps to enable newer OSes in the script
The WMIDiag main part is a very large VBScript that is pretty easy to modify. Extract the files to any folder and then open the file WMIDiag.vbs in the editor.
Move to line 147 to see the "known" operating systems. We need to insert two lines at line 167:
Const cWindows2008R2 = 262144
Const cWindows7 = 524288
Const cWindows7 = 524288
Now we have defined internal IDs for Win2008R2 and Win7, and it's time to use them. Go to line 10776 (should read "Case Else"), and before that, insert the following block:
Case "6.1" ' Windows 7
If RunTimeEnvironmentInfo.IsServerOS Then
GetOSVersion = cWindows2008R2
RunTimeEnvironmentInfo.OSBrandVersion = "2008 R2"
RunTimeEnvironmentInfo.ProductFullName = "Windows 2008 Server R2 - No service pack - " & RunTimeEnvironmentInfo.ProcessorArchitecture
RunTimeEnvironmentInfo.ProductShortName = RunTimeEnvironmentInfo.NTBuild & "_.SRV.RTM"
Else
GetOSVersion = cWindows7
RunTimeEnvironmentInfo.OSBrandVersion = "Windows 7"
RunTimeEnvironmentInfo.ProductFullName = "Windows 7"
RunTimeEnvironmentInfo.ProductShortName = "VISTA.CLI"
End If
If RunTimeEnvironmentInfo.Is64 = False Then
RunTimeEnvironmentInfo.ProductShortName = RunTimeEnvironmentInfo.ProductShortName & ".32"
Else
RunTimeEnvironmentInfo.ProductShortName = RunTimeEnvironmentInfo.ProductShortName & ".64"
End If
If RunTimeEnvironmentInfo.IsServerOS Then
GetOSVersion = cWindows2008R2
RunTimeEnvironmentInfo.OSBrandVersion = "2008 R2"
RunTimeEnvironmentInfo.ProductFullName = "Windows 2008 Server R2 - No service pack - " & RunTimeEnvironmentInfo.ProcessorArchitecture
RunTimeEnvironmentInfo.ProductShortName = RunTimeEnvironmentInfo.NTBuild & "_.SRV.RTM"
Else
GetOSVersion = cWindows7
RunTimeEnvironmentInfo.OSBrandVersion = "Windows 7"
RunTimeEnvironmentInfo.ProductFullName = "Windows 7"
RunTimeEnvironmentInfo.ProductShortName = "VISTA.CLI"
End If
If RunTimeEnvironmentInfo.Is64 = False Then
RunTimeEnvironmentInfo.ProductShortName = RunTimeEnvironmentInfo.ProductShortName & ".32"
Else
RunTimeEnvironmentInfo.ProductShortName = RunTimeEnvironmentInfo.ProductShortName & ".64"
End If
You should find the "Case Else" on line #10794 or #10795. You may insert blank lines to make the script look nicer, but there is no syntactical need for them. Now save the file.
This hack is not perfect - Windows 7 will be identified as "VISTA.CLI.32" or "VISTA.CLI.64" depending on the OS bitness, but I think this better not change because it might cause side-effects on the tests that are run. You will find this string in the report file and the Excel sheet that is created - never mind. You know from a lot of other indicators that it's actually not Vista.
Finally, move to line #17270 and change it as follows:
Case cWindowsVistaRTM, cWindowsVistaSP1, cWindowsLonghornRTM, cWindows2008R2, cWindows7
Running the script
- I'd recommend running the script in a shell instead of just double-clicking it as inside the shell you can see the script's progress. So, open the start menu, enter cmd in the search box and hold both Ctrl and Shift while clicking the Command Prompt entry shown in the results list. This will ensure that the command prompt is started with administrative privileges which you will have to confirm by a UAC prompt that opens right after you clicked.
- Once the command prompt is open, enter Cscript.Exe /H:Cscript to make CScript your default script environment.
- CD to the directory where you put the modified WMIDiag script
- enter wmidiag to run the script
Good luck!
Well, now I can start digging the output for hints on what is actually wrong here :o|
2013-04-23 Version 2.1 Bugfix
Hi all,after Microsoft updated the WMIDiag script to version 2.1 to include Windows 7 and 2008 R2 (well, about time now that Server 2012 and Windows 8 are out!), they included a bug again for our delight.
The structure of the statistics CSV file that is rendered in the TEMP directory by default is missing two columns. Therefore, the Excel output will not be okay once you imported the CSV file into it.
I think I found the missing columns. In Excel, it is the columns AD and AE. The CSV file is missing them, so everything right to the column AC is shifted left by two columns.
There are two ways to fix this:
- modify the Excel sheet and remove the columns highlighted before importing the CSV
- importing the file and then shifting everything in the line to which you imported from AD:CM two columns to the right
Shifting can be done easiest by selecting the range from AD thru CM, then using the clipboard to mark the selection as to-be-cut (with Ctrl-X), then placing the cursor into the column AT and then pasting (Ctrl-V). Please be sure to mark the cells of only the row you importeed, not the entire table with column headers etc.
It's a dirty hack, I agree, and it won't bring you back the information of how the WMI repository size changed in relation to before the script was run. Sorry, but I'll look for a fix.
Have fun!
2013-04-24 Version 2.1 Final Bugfix
Guys, I figured it out! There is an inactive line of code that should obviously be active. This circumstance causes the disk space measurements to take place only after the WMIDiag process, not before, even though these two additional values are expected in the Excel sheetThe problem is in line #1317 of the WMIDiag.vbs file. You can easily spot it by searching for "BEFORE" (with the quotation marks and in capital letters) with any editor. The first matching line is this one:
' boolRC = CheckWMIRepositoryFiles (objLOGFileHandle, "BEFORE")
To activate the line, remove the apostrophe character ( ' ) before boolRC. Please do this only if the line reads exactly like what is shown above. There are more lines matching the search expression, so be sure to hit only the first one of them.
The structure of the CSV output then matches the XLS columns perfectly again :)
You can get the fix from here (it is a ZIP archive containing all files of the original WMIDiag.exe, except for the fixed .vbs file)
Hope I could help some of you.
2013-06-12 Version Adjusted for Windows 8 + 2012
Based on the VBS script from 2013-04-24 (see above), I have added OS version constants and code to identify Windows 8 and Windows Server 2012, however I don't have any Windows Server 2012 installation here, so I could not properly test that.For Windows 8, a whole lot of errors are logged in the C:\Windows\WBEM area. Don't know if that is only my system (it's a virtual machine I set up when the first free beta of Windows 8 was released).
Please check it out and let me know if you feel anything is wrong about it.
Get your ZIP here
Regards,
Joe
2014-06-30 Version Adjusted for Windows 8.1
Based on the VBS script from 2013-06-12 (see above), I have added OS version constants and code to identify Windows 8.1. Internally it has version "6.3".SP1 recognition has been added, too, although it is not clear at this time whether it will work properly. Likewise, it is still unknown when and if Windows 2012 Server will switch its version to 6.3. I think that is likely to happen if there will ever be a 2012 R2 edition. The VBS script will not recognize 6.3 server products for now however because there are too many uncertainties. I hope that is okay for all of you.
Thanks to Chris for notifying me about the 8.1 problems :)
Get your updated ZIP here
Regards,
Joe