How to: Create a WMI Object

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Speech Server manages configuration data using Windows Management Instrumentation (WMI) objects. There are two ways to create WMI objects in Speech Server:

  • Use a WMI script. A WMI script can create a WMI object by instantiating an object of the MSS, Application, SIPPeer, or TrustedSIPPeer class and then assigning values to the object properties.
  • Use the Speech Server??Administrator console. When you use this tool to add a server, application, SIP peer, or trusted SIP peer, you are actually creating WMI objects in the MSS, Application, SIPPeer, or TrustedSIPPeer class. The Speech Server??Administrator console provides an easy-to-use graphical interface for creating WMI objects. For more information, see Speech Server Administration.

The following VBScript example shows how to use the SpawnInstance_() method to create a SIPPeer and TrustedSIPPeer object. For more information about the SpawnInstance_() method, see SWbemObject.SpawnInstance.

strComputer = "." 

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\MSSV2") 

Set objPeerClass = objWMIService.Get("SIPPeer")

Set objPeer = objPeerClass.SpawnInstance_()

objPeer.Name = "MySIPPeer"
objPeer.Address = "localhost"
objPeer.TCPPort = 5060
objPeer.TLSPort = 5061
objPeer.Type = "Default"
objPeer.UseDefaultPorts = True
objPeer.UseMutualTLS = False

objPeer.Put_

wscript.echo "Created SIP peer = " & objPeer.Name

Set objPeerClass2 = objWMIService.Get("TrustedSIPPeer")

Set objPeer2 = objPeerClass2.SpawnInstance_()

objPeer2.Name = "MySIPPeer"
objPeer2.Address = "localhost"
objPeer2.TCPPort = 5060
objPeer2.TLSPort = 5061
objPeer2.Type = "Default"
objPeer2.UseMutualTLS = False
objPeer2.AllowOutboundCalls = False
objPeer2.AllowTransfers = False

objPeer2.Put_

wscript.echo "Created trusted SIP peer = " & objPeer2.Name

You can use similar scripts to create MSS and Application class objects.

Note

If you create a SIPPeer and TrustedSIPPeer object with type equal to TIMC, you must create a TIMC object and configure the TIMC-specific settings.

See Also

Reference

MSS Class
Application Class
SIPPeer Class
TrustedSIPPeer Class
TIMC Class