Compartir a través de


How to: Use WMIC to Access Speech Server Objects

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.

In addition to scripting, you can access instances of Speech Server WMI classes using the Windows Management Instrumentation command-line (WMIC), a Windows utility that can be run in interactive or non-interactive modes. In interactive mode, you start WMIC at the command prompt and then enter commands. In non-interactive mode, you run the WMIC command with all necessary switches and values from the command prompt. When WMIC execution is complete, it returns you to the command prompt. Either way, WMIC provides a quick way to query WMI objects, set properties, and execute methods without scripting.

Note

WMIC is part of the Microsoft Windows operating system. When you run it for the first time, Windows installs WMIC automatically.

The following sections simple examples (in both interactive and non-interactive mode) for querying objects, setting properties, and executing methods with WMIC. For more information, see Windows Management Instrumentation Command-line.

Querying an Object

To query a Speech Server WMI object, use the following parts of the WMIC syntax:

  • /namespace switch to specify the WMI namespace
  • path to access the instance of a specified class
  • get /value to retrieve the property settings
  • The following examples show how to query the instance of the MSS class and retrieve its property values.

WMIC Query Example (Interactive Mode)

C:\>wmic

wmic:root\cli>/namespace:\\root\mssv2

wmic:root\cli>path MSS get /value

AudioConnectionIP=

AudioConnectionMaxPort=65535

AudioConnectionMinPort=1024

InactiveTimeout=120

InstallDir=C:\Program Files\Microsoft Office Communications Server 2007 Speech Server\

MaxDiskCacheSize=1024

MaxIncomingCalls=-1

MaxOutgoingCalls=-1

RemotingPort=8036

ShutdownTimeout=300

TCPListeningPort=5060

TLSCertIssuerName=

TLSCertSerialNumber=

TLSListeningPort=5061

UpperMemoryThreshold=1600

UseMss2004TIM=FALSE

WireCodecList={"RTAudio16KHz","RTAudio8KHz","G.723.1(6.3)","G.711u","G.711A"}

WorkerProcessRecycleTime=03:00

WorkerStartupTimeout=900

WorkingFilesLocation=%Temp%

wmic:root\cli>

WMIC Query Example (Non-Interactive Mode)

C:\>Wmic /namespace:\\root\mssv2 path MSS get /value

AudioConnectionIP=

AudioConnectionMaxPort=65535

AudioConnectionMinPort=1024

InactiveTimeout=120

InstallDir=C:\Program Files\Microsoft Office Communications Server 2007 Speech Server\

MaxDiskCacheSize=1024

MaxIncomingCalls=-1

MaxOutgoingCalls=-1

RemotingPort=8036

ShutdownTimeout=300

TCPListeningPort=5060

TLSCertIssuerName=

TLSCertSerialNumber=

TLSListeningPort=5061

UpperMemoryThreshold=1600

UseMss2004TIM=FALSE

WireCodecList={"RTAudio16KHz","RTAudio8KHz","G.723.1(6.3)","G.711u","G.711A"}

WorkerProcessRecycleTime=03:00

WorkerStartupTimeout=900

WorkingFilesLocation=%Temp%

C:\>

Setting a Property

To set a property of a Speech Server WMI object to a new value, use the following parts of the WMIC syntax:

  • /namespace switch to specify the WMI namespace
  • path to access the instance of a specified class
  • set propertyName="value" to set the new value of the property

The following examples show how to set the Enabled property of the Application instance called MyApp to true.

WMIC Property Setting Example (Interactive Mode)

C:\>wmic

wmic:root\cli>/namespace:\\root\mssv2

wmic:root\cli>path Application where Name="MyApp" set Enabled="True"

Update property(s) of '\\server\root\mssv2:Application.Name="MyApp"' (Y/N/?)? y

Property(s) update successful.

wmic:root\cli>

WMIC Property Setting Example (Non-Interactive Mode)

C:\>wmic /namespace:\\root\mssv2 Application where Name="MyApp" set Enabled="True"

Updating property(s) of '\\myServer\root\mssv2:Application.Name="MyApp"' Property(s) update successful.

C:\>

Executing a Method

To execute a method of a Speech Server WMI object, use the following parts of the WMIC syntax:

  • /namespace switch to specify the WMI namespace
  • path to access the instance of a specified class
  • call to execute the method

The following examples show how to execute the RefreshSettings method of the MSS instance myServer (make sure to use two underscore characters when entering the property __Server).

WMIC Method Execution Example (Interactive Mode)

C:\>wmic

wmic:root\cli>/namespace:\\root\mssv2

wmic:root\cli>path MSS.__Server="myServer" call RefreshSettings

Execute (\\myServer\root\mssv2:MSS=@)->RefreshSettings() (Y/N/?)? y

Method execution successful.

Out Parameters:

instance of __PARAMETERS

{

ReturnValue = 0;

};

wmic:root\cli>

WMIC Method Execution Example (Non-Interactive Mode)

C:>wmic /namespace:\\root\mssv2 path MSS.__Server="myServer" call RefreshSettings

Executing (\\myServer\root\mssv2:MSS=@)->RefreshSettings()

Method execution successful.

Out Parameters:

instance of __PARAMETERS

{

ReturnValue = 0;

};

C:\