T
Tom Ker
This is part of a script I run on multiple versions of Windows....
Set oWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
sCompName & "\root\cimv2")
Set cOperatingSystems = oWMIService.ExecQuery("Select * from
Win32_OperatingSystem")
For Each oOperatingSystems in cOperatingSystems
wscript.echo oOperatingSystems.Caption
Next
This works on Windows 2000 (all SPs), Windows XP (all SPs), and Windows
2003, but does not work on Windows 2003 SP1. I get an error 8004101D with
no other explanation on the "For Each..." line. Or I get an error 80010108
with "The object invoked has disconnected from its clients." on the same
line. I get the same results whether sCompName contains "." or the actual
ComputerName.
Any thoughts?
Thanks,
Tom
Set oWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
sCompName & "\root\cimv2")
Set cOperatingSystems = oWMIService.ExecQuery("Select * from
Win32_OperatingSystem")
For Each oOperatingSystems in cOperatingSystems
wscript.echo oOperatingSystems.Caption
Next
This works on Windows 2000 (all SPs), Windows XP (all SPs), and Windows
2003, but does not work on Windows 2003 SP1. I get an error 8004101D with
no other explanation on the "For Each..." line. Or I get an error 80010108
with "The object invoked has disconnected from its clients." on the same
line. I get the same results whether sCompName contains "." or the actual
ComputerName.
Any thoughts?
Thanks,
Tom