I suspect line2: Set colSettings = "", just turn off 'error resume'
and you'll see whats breaking.

On 5/26/06, Hutchins, Mike <[EMAIL PROTECTED]> wrote:
If I use this, everything gets "Server1++" nothing ever gets anywhere.
:-)



'=========================================
For Each strComputer In serverList
      Set colSettings = ""
      Set objWMIService = GetObject("winmgmts:" _
      & "{impersonationLevel=impersonate}!\\" & strComputer &
"\root\cimv2")
     Set colSettings = objWMIService.ExecQuery _
      ("Select * from Win32_OperatingSystem")

    If err then
         WScript.Echo strComputer + "++"
    else
        Set colSettings = objWMIService.ExecQuery _
       ("Select * from Win32_OperatingSystem")
       For Each OS In colSettings'
          WScript.Echo strComputer + "+" + OS.Caption + "+" +
OS.Version
       Next
    end if
Next
'=========================================

Rgds,
Tim


List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.activedir.org/ml/threads.aspx

Reply via email to