WMI namespace 'root/SecurityCenter' does not appear

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
User avatar
greyhat64
Posts: 246
Joined: Fri Mar 14, 2008 9:10 am
Location: USA

WMI namespace 'root/SecurityCenter' does not appear

Post by greyhat64 »

Since I 'butted in' on the earlier WMI 'BizTalk' thread, I'll restate my WMI question(s):
Do you guys have an general advice for using/troubleshooting the WMI test method? Here's my problem:

I've been working with another namespace 'root\SecurityCenter', that does not present itself in WMIExplorer. If it is present (not available on al machines/OS's) it's a great source of info for Firewall and AntiVirus status.
I could modify the VBScript snippet below to work, but it seems I should be able to use the HM's WMI test method to accomplish this.

Code: Select all

Option Explicit
On Error Resume Next

strComputer = "."
    
Set oWMI = GetObject( _
  "winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\SecurityCenter")
  
Set colItems = oWMI.ExecQuery("Select * from AntiVirusProduct")
For Each objItem in colItems
  With objItem
    WScript.Echo "Company: " & .companyName
    WScript.Echo "Product Name: " & .displayName
    WScript.Echo "Version: " & .versionNumber
    WScript.Echo "GUID: " & .instanceGuid
    WScript.Echo "ScanEnabled: " & .onAccessScanningEnabled
    WScript.Echo "ExePath: " & .pathToSignedProductExe
    WScript.Echo "UserNotified: " & .productHasNotifiedUser
    WScript.Echo "State: " & .productState
    WScript.Echo "UptoDate: " & .productUptoDate
    WScript.Echo "WscNotifications? " & .productWantsWscNotifications
  End With
Next
' Note:  Not all properties are available with all AV products.
The fact is that I'd like NOT to :x , but I'm building up quite a WMI code library because of situations like this.

So, why do all namespaces not appear in WMI Explorer, even though they are present and can be queried?
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Re: WMI namespace 'root/SecurityCenter' does not appear

Post by KS-Soft Europe »

greyhat64 wrote:So, why do all namespaces not appear in WMI Explorer, even though they are present and can be queried?
Actually, WMI Explorer does not enumerate available namespaces at all. It's not a problem because you may type desirable namespace manually using menu "File" -> "Connect to remote host". So, after you enter certain namespace, WMI Explorer populates classes list, if namespace is available on target machine.

Beside that, WMI Explorer uses WMI data, that Windows allows to use. It means if you have some security issues, you will get "Access denied" error, or something like that.

We just tested WMI Explorer 1.04 in order to get data from root\SecurityCenter namespace on Windows XP SP3 machine. Everything looks fine.
Have you faced to any problems?
What exact problems have you faced?
Do you see any errors?


Regards,
Max
User avatar
greyhat64
Posts: 246
Joined: Fri Mar 14, 2008 9:10 am
Location: USA

Post by greyhat64 »

Yeah, I had found that, but was thrown aback when the 'Name Space' dropdown list wasn't populated with the available namespaces.
Since you populate other dropdown lists (services in the Service test method, for instance) I guess I was expecting it and was a bit taken aback when that wasn't the case.
Otherwise we're on the hook for knowing every servers' namespace list. :-?
I've since found that it's a simple query:

Code: Select all

strComputer = "."
Call EnumNameSpaces("root")
 
Sub EnumNameSpaces(strNameSpace)
    WScript.Echo strNameSpace
    Set objWMIService=GetObject _
        ("winmgmts:{impersonationLevel=impersonate}\\" & _ 
            strComputer & "\" & strNameSpace)

    Set colNameSpaces = objWMIService.InstancesOf("__NAMESPACE")

    For Each objNameSpace In colNameSpaces
        Call EnumNameSpaces(strNameSpace & "\" & objNameSpace.Name)
    Next
End Sub
And while I'm dreaming, :wink: It would be preferable that is was a three pane view, with Namespaces in the left pane and Classes in the right, with a bottom pane that gets populated with the available Properties. The option to connect to a remote computer would then simply be the computer name, logon, & password.
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

greyhat64 wrote:Since you populate other dropdown lists (services in the Service test method, for instance) I guess I was expecting it and was a bit taken aback when that wasn't the case.
Ok, population namespaces feature will be implemented.

Regards,
Max
Post Reply