I've been working with Terry on this for our environment and would like to share some additional information:
I have created a vbscript file (content below), with embedded remote ip, username & password. When I run this manually on the PRTG core server from a command prompt ("cscript somescript.vbs"), it executes and returns the expected value from the remote machine. When I create a custom exe sensor and select this script, it repeatedly fails with [Response not wellformed: "C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXE\somescript.vbs(13, 1) (null): 0x80041010 "]. The query in this script is similar/same to the one Terry was using in the Custom WMI Sensor he was working on.
Copy/Pasting the query into the Paessler WMI Tester fails with the same hex error 0x80041010.
strComputer = "172.29.234.8"
strUser = "s_prtg"
strPassword = "somepassword"
strNamespace = "root/cimv2"
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objLocator.ConnectServer(strComputer,strNamespace,strUser,strPassword)
Set objResults = objWMIService.ExecQuery ("Select AvgRecipientsPermsgReceived from Win32_PerfRawData_SMTPSVC_SMTPServer WHERE name= 'SMTP 1'")
For Each colResult in objResults