cbodnar
2005-08-26 14:00:31 UTC
I'm new to VBscript so be kind:
It seems to me that you can do the same thing with both of these
examples:
Ex1:
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_Service",,48)
Ex2:
Set SWBemlocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService =
SWBemlocator.ConnectServer(strComputer,"\root\CIMV2",UserName,Password)
Set colItems = objWMIService.ExecQuery("Select * from
Win32_Service",,48)
Can someone point me to a good source for the difference between the
two? When to use one over the other?
I apprecaite any replies.
Thanks
Chris
It seems to me that you can do the same thing with both of these
examples:
Ex1:
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_Service",,48)
Ex2:
Set SWBemlocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService =
SWBemlocator.ConnectServer(strComputer,"\root\CIMV2",UserName,Password)
Set colItems = objWMIService.ExecQuery("Select * from
Win32_Service",,48)
Can someone point me to a good source for the difference between the
two? When to use one over the other?
I apprecaite any replies.
Thanks
Chris