I use GetObject() to locate a computer and pass on the object to another function (so it could do things like object.GetObject() to locate an NT Service.
However, I am having problem trying to read back the name of the computer from the Computer Object I obtained through
All the following results in Object required error, with or without the
:
Note if I do the above before returning the Object at the function which does the GetObject, they all fail except objComputer.Class would work over there.
What is wrong?
However, I am having problem trying to read back the name of the computer from the Computer Object I obtained through
Code:
Set objComputer = GetObject("WinNT://compName,computer")
All the following results in Object required error, with or without the
Code:
CStr
Code:
CStr(objComputer.ComputerID)
CStr(objComputer)
CStr(objComputer.Class)
Note if I do the above before returning the Object at the function which does the GetObject, they all fail except objComputer.Class would work over there.
What is wrong?