SetAllowTSConnections method of the Win32_TerminalServiceSetting class

The SetAllowTSConnections method allows or denies new remote desktop connections. This method will modify the AllowTSConnections property for the class accordingly.

Syntax

uint32 SetAllowTSConnections(
  [in] uint32 AllowTSConnections,
  [in] uint32 ModifyFirewallException
);

Parameters

AllowTSConnections [in]

Specifies whether new remote desktop connections are allowed. This must be one of the following values.

0

New connections are not allowed. If the ModifyFirewallException parameter is 1, then the Remote Desktop firewall exception is disabled.

1

New connections are allowed. If the ModifyFirewallException parameter is 1, then the Remote Desktop firewall exception is enabled.

ModifyFirewallException [in]

Specifies if the firewall exception setting for Remote Desktop will be modified to the state specified by the AllowTSConnections parameter. This must be one of the following values.

0

Do not modify the firewall exception setting.

1

Modify the firewall exception setting.

Return value

Returns Success on success; otherwise, returns a WMI error code. Refer to Remote Desktop Services WMI Provider Error Codes for a list of these values. The method returns an error if the setting is under group policy control.

Remarks

Managed Object Format (MOF) files contain the definitions for Windows Management Instrumentation (WMI) classes. MOF files are not installed as part of the Microsoft Windows Software Development Kit (SDK). They are installed on the server when you add the associated role by using the Server Manager. For more information about MOF files, see Managed Object Format (MOF).

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Namespace
Root\CIMv2\TerminalServices
MOF
TSCfgWmi.mof
DLL
TSCfgWmi.dll

See also

Win32_TerminalServiceSetting