WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: krasdude on February 05, 2015, 06:53:51 AM

Title: WMI Question (RSOP_SecurityEventLogSettingNumeric)
Post by: krasdude on February 05, 2015, 06:53:51 AM
I am trying to read from WMI NameSpace Root/RSOP/Computer, class RSOP_SecurityEventLogSettingNumeric.  I tried the following with no success:

ComputerName = "."
oWMIService = GetObject("winmgmts:\\":ComputerName:"\root\RSOP\Computer")
oItems = oWMIService.ExecQuery("Select * from RSOP_SecurityEventLogSettingNumeric")

If oItems.Count == 0 Then
    Display(2,"","Appears to have failed")
    exit
Else
    ForEach oItem In oItems
       message("",oItem.name)
    Next
EndIf

oItem=0
oItems=0
oWMIService=0
Exit

Can I read from this namespace and if so, what did I miss?

Thanks

Micahel
Title: Re: WMI Question (RSOP_SecurityEventLogSettingNumeric)
Post by: td on February 05, 2015, 07:09:45 AM
Just a guess but the following MSFT forum article may offer an explanation

https://social.technet.microsoft.com/Forums/scriptcenter/en-US/18899d9b-5320-4dad-a40b-724b831bb9a0/vbs-failing-for-rsopsecurityeventlogsettingnumeric-and-other-rsop-on-win-2008-win-2008-r2?forum=ITCG (https://social.technet.microsoft.com/Forums/scriptcenter/en-US/18899d9b-5320-4dad-a40b-724b831bb9a0/vbs-failing-for-rsopsecurityeventlogsettingnumeric-and-other-rsop-on-win-2008-win-2008-r2?forum=ITCG)