Forum Discussion

egbea's avatar
egbea
Occasional Contributor
13 years ago

WMI-WbemScripting.SwbemLocator problem

Hello everyone.

 I am writing script that will monitor remote machine (Server) memory usage from my local PC.

However, the following line of code is giving me nightmares in that, it will return null object.

 Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")



I have enabled enabled WMI service. I have also allow Security for Root\CIMV2 by enabling Remote permission in

both my local machine and remote server and it still not creating object.

I will appreciate any advice and suggestion to overcome this problem. Without creating object, I cannot move forward

to connect to the remote server as shown.

 Set objWMIService = objSWbemLocator.ConnectServer(Computer, _

      "root\CIMV2", _

       Login, _

       Password, _

       "MS_409", _

       "NTLMDomain:" + strDomain)



I will like to add that my Client PC is Windows 7 and Remote Machine is Windows 2008r2 Server.

Thank you,

Egbe.
  • Hello Egbe -

    Could you tell me which of our SmartBear applications you are using? Then I can get your question to the right forum.

    Thanks!
  • egbea's avatar
    egbea
    Occasional Contributor
    Hello Barbara,

    Thank you for getting back to me.

    I am using TestComplete 8 Enterprise edition Version 8.70.727.7.

    Here are other things I have done so far to try and get it to work, still there is no luck.

    1  I granted DCOM remote launch and activation permissions for  group

    2  I granted DCOM remote access permissions

    3. In the Control Panel, I clicked Security and then clicked Windows Firewall.

    4. I then clicked Change Settings and then clicked the Exceptions tab.

    5. In the Exceptions window, I selected the check box for Windows Management Instrumentation (WMI) to enable WMI traffic through the

       firewall.

    Egbe
  • Hi Egbe!

    I'm going to move this over to the TestComplete forums - they'll help you out over there.

    Thanks!