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.
uint32 SetAllowTSConnections( [in] uint32 AllowTSConnections, [in] uint32 ModifyFirewallException );
Specifies whether new remote desktop connections are allowed. This must be one of the following values.
New connections are not allowed. If the ModifyFirewallException parameter is 1, then the Remote Desktop firewall exception is disabled.
New connections are allowed. If the ModifyFirewallException parameter is 1, then the Remote Desktop firewall exception is enabled.
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.
Do not modify the firewall exception setting.
Modify the firewall exception setting.
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.
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).
|Minimum supported client
|Minimum supported server
||Windows Server 2008