Configuring Terminal Services with WMI

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

Configuring Terminal Services with WMI

In Microsoft® Windows Server 2003 family operating systems, you can use the Terminal Services WMI provider to create scripts for remote administration of terminal servers.

About the Terminal Services WMI Provider

The Terminal Services Windows Management Instrumentation (WMI) provider allows administrators to create customized scripts for configuring, managing, and querying terminal servers. It contains properties and methods that can perform the same tasks as the Terminal Services configuration tools and command-line utilities provided with Windows Server 2003 family operating systems, but remotely and through scripted applications.

How the Provider Works

Windows Management Instrumentation (WMI) defines a unified architecture for describing, accessing, and instrumenting objects. Part of this architecture is a large database of WMI classes used to carry out remote management tasks on specific objects.

A provider extends the WMI schema of classes to allow WMI to work with new types of objects. The Terminal Services Provider defines classes for querying and configuring Terminal Services.

The Terminal Services Provider is defined in %systemroot%\System32\Wbem\tscfgwmi.mof.

A general description of the classes associated with the provider can be seen in the following table. For complete list of properties and methods associated with each class, please see the embedded comments in the Terminal Services provider MOF file (tscfgwmi.mof). The contents of this file can be viewed with the Windows Management Instrumentation Tester (Wbemtest.exe), which is located in the %systemroot%\System32\Wbem\. To view the .mof file in Wbemtest, use the procedure below.

To view the Terminal Services Provider classes in Wbemtest.exe

  1. Open Wbemtest.exe

  2. Click Connect.

  3. In Namespace, type root\Cimv2

  4. Click Connect.

  5. Click Open Instance.

  6. In Object Path, type the name of the Terminal Services Provider class (see the table below for the names of the classes.) Click OK.

  7. In Properties, click the name of the property you want to view, and then click Show MOF.

Terminal Services WMI Classes

The Terminal Services Provider has the following WMI classes.

WMI Class Description


The Win32_TerminalService class is a subclass of Win32_Service class and inherits all its properties and methods. In addition, Win32_TerminalService represents the Element property of the Win32_TerminalServiceToSetting association.


Defines the configuration for Win32_TSSessionDirectorySetting. This includes properties such as Session Directory store, Cluster Name and Additional parameters.


Defines the configuration for TerminalServerSetting. This includes properties such as Terminal Server Mode, Licensing, Active Desktop, Permissions Capability, Deletion of Temporary folders and per-session Temporary folders.


Associates a TerminalSetting and its several configuration setting groups such as: General, Logon, Session, Environment, Remote Control, Client, Network Adapter and Permission.


Defines the configuration for properties such as Protocol, Transport, Comment, Windows authentication and Encryption Level


Defines the configuration for properties such as ClientLogonInfoPolicy, UserName, Domain, and Password.


Defines the configuration for properties such as time limit policy for connections and session limits for active, idle, and disconnected sessions.


Defines the configuration for properties such as Initial program policy, Initial program path, Start in, and Client wallpaper.


Defines the configuration for properties such as Remote Control policy and level of control.


Defines the configuration for properties such as Connection policy, Windows printer mapping, Comport mapping, etc.


Defines the configuration for properties such as LAN Adapter and Maximum number of connections


Enumerates the list of network adapters that are configurable for Win32_Terminal based on the Terminal Protocol and Transport. The properties include: TerminalProtocol, Transport, NetworkAdapterID, and Description.


Represents an association between a Win32_Terminal and its configuration settings (Win32_TSAccount). Contains properties for adding accounts to defined permission sets and restoring default permissions.


Defines the configuration for properties such as SID, Allowed and denied permissions.


  • This documentation describes only the classes, methods, and associations specific to Terminal Services. Top-level WMI classes (those with the CIM_ prefix) that are defined in the MOF file are not specific to Terminal Services and are described in the Platform SDK documentation for Windows Management Instrumentation (WMI).

For an overview of WMI, see WMI Overview.

For a complete description and definition of WMI, as well as technical information about developing for the WMI system, see the WMI Software Development Kit (SDK). The WMI SDK is released by MSDN as part of the Microsoft Platform SDK.

Information about functional differences

  • Your server might function differently based on the version and edition of the operating system that is installed, your account permissions, and your menu settings. For more information, see Viewing Help on the Web.