setver and service both return object references, but when I try to set parameters such as url or exchange version, I always get an error. I'm assuming I don't know the correct syntax for this to work. I'm hoping to find someone who has been through this and can point me in the right direction.

In the future when you post something like "I got an error", also post the error number and any additional error information that is displayed by clicking the "More Error Info" button when enabled.

CLR methods and properties are strongly type so whenever you encounter a problem, parameter and right-hand side type information is usually the first place to check. There are several ways to solve type related problems. Sometimes all you need to do is specify the COM Automation type with a method parameter and WinBatch will convert it to the correct FCL system type. There are times when this is not sufficient and you need to specify the FCL system type like "system.string" or whatever. There are times when this is not sufficient (enum types being the most common) and you need to use the ObjectClrType function to create a properly typed value to pass to a class object method. The function ObjectClrType is also useful for type casting the right-hand side of class object property assignments. About the only way to discover and fix typing issues is through trial-and-error. Once you get the hang of it, it becomes relatively straight forward and often obvious.

There are numerous example in the Tech Database that should help you get started. Try searching on 'dotNet' or 'ObjectClrNew' for starters.

Logged

"Success is a lousy teacher. It seduces smart people into thinking they can't lose." - Bill Gates

;; The following line uses the typed enum value as a parameter to the class constructor for the 'EventLogQuery' class. objLogQuery =ObjectClrNew('System.Diagnostics.Eventing.Reader.EventLogQuery','Microsoft', LogName, strQuery)