DisconnectProtocol method of the Win32_TSGatewayConnection class

Disconnects all connections of the specified protocol from the Remote Desktop Gateway (RD Gateway) server.

Syntax

uint32 DisconnectProtocol(
  [in] string ProtocolName
);

Parameters

ProtocolName [in]

The protocol name for a specific connection. This can be retrieved from the ProtocolName property of the Win32_TSGatewayConnection class.

"TS"

The protocol for the RD Gateway server.

Return value

If the method succeeds, it returns zero. If the method is unsuccessful, it returns a nonzero value. For a list of error codes, see Remote Desktop Services WMI Provider Error Codes.

Remarks

You must be a member of the Administrators group to call this method.

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
None supported
Minimum supported server
Windows Server 2008
Namespace
Root\CIMv2\TerminalServices
MOF
TSGateway.mof
DLL
AagWmi.dll

See also

Win32_TSGatewayConnection