Returns the ID of the server to which Remote Desktop Connection Broker (RD Connection Broker) should direct the incoming connection. The redirection logic of the plug-in determines the preferred server.
Syntax
HRESULT WTSSBX_GetMostSuitableServer(
[in] WCHAR *UserName,
[in] WCHAR *DomainName,
[in] WCHAR *ApplicationType,
[in] WCHAR *FarmName,
[in, out] long *pMachineId
);
Parameters
- UserName [in]
-
A pointer to a Unicode string that contains the user name of the incoming connection.
- DomainName [in]
-
A pointer to a Unicode string that contains the domain name that is associated with the incoming connection.
- ApplicationType [in]
-
A pointer to a Unicode string that contains the name of the program that Remote Desktop Services runs after it creates the session.
- FarmName [in]
-
A pointer to a Unicode string that contains the name of the farm in RD Connection Broker that the user is connecting to.
- pMachineId [in, out]
-
A pointer to the ID of the server to which RD Connection Broker will redirect the incoming connection. This value is initially set to the ID of the server provided by the load balancing logic of RD Connection Broker.
Return Value
Returns S_OK if successful.
Remarks
Use WTSSBX_GetMostSuitableServer to override the default load balancing logic of RD Connection Broker. RD Connection Broker calls this method after it runs its own load balancing logic. The pMachineId parameter is initially set to the ID of the server provided by the load balancing logic of RD Connection Broker. When you implement this method, your redirection logic can return this pMachineId or another one as appropriate.
Whenever a server joins a farm in RD Connection Broker, RD Connection Broker calls the WTSSBX_MachineChangeNotification method to notify the plug-in and provide a MachineId to identify the new server. When RD Connection Broker calls WTSSBX_GetMostSuitableServer, the plug-in should return one of the IDs that RD Connection Broker provided to the plug-in. The plug-in should not return the ID of a server that is not in the farm.
Your implementation of WTSSBX_GetMostSuitableServer must return S_OK immediately if successful.
Requirements
| Minimum supported client | Windows XP |
| Minimum supported server | Windows Server 2008 |
| Header | Tssbx.h |
| IDL | Tssbx.idl |
| IID | IID_IWTSSBPlugin is defined as DC44BE78-B18D-4399-B210-641BF67A002C |
See Also
- IWTSSBPlugin
Send comments about this topic to Microsoft
Build date: 6/26/2009