' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms) ' (c) 2015 Borja Sanchez ' This plugin extends agent inventory feature. Only enterprise version ' -------------------------------------------------------------------------- 'WMI domain/workgroup info strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery("SELECT Domain FROM Win32_ComputerSystem") on error resume next flag = colItems.Count If (err.number <> 0) Then flag = true Else flag = false End If on error goto 0 'Print only when there's results If (NOT flag) Then Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine "Domain" Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine "" For Each objItem In colItems WScript.StdOut.WriteLine "" Next Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine "" End If