IWTSSBPlugin::WTSSBX_GetMostSuitableServer method (tssbx.h)
Returns the ID of the server to which Terminal Services Session Broker (TS Session Broker) should direct the incoming connection. The redirection logic of the plug-in determines the preferred server.
HRESULT WTSSBX_GetMostSuitableServer( [in] WCHAR *UserName, [in] WCHAR *DomainName, [in] WCHAR *ApplicationType, [in] WCHAR *FarmName, [in, out] long *pMachineId );
A pointer to a Unicode string that contains the user name of the incoming connection.
A pointer to a Unicode string that contains the domain name that is associated with the incoming connection.
A pointer to a Unicode string that contains the name of the program that Remote Desktop Services runs after it creates the session.
A pointer to a Unicode string that contains the name of the farm in TS Session Broker that the user is connecting to.
[in, out] pMachineId
A pointer to the ID of the server to which TS Session Broker will redirect the incoming connection. This value is initially set to the ID of the server provided by the load balancing logic of TS Session Broker.
Returns S_OK if successful.
Use WTSSBX_GetMostSuitableServer to override the default load balancing logic of TS Session Broker. TS Session 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 TS Session 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 TS Session Broker, TS Session Broker calls the WTSSBX_MachineChangeNotification method to notify the plug-in and provide a MachineId to identify the new server. When TS Session Broker calls WTSSBX_GetMostSuitableServer, the plug-in should return one of the IDs that TS Session 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.
|Minimum supported client||Windows Vista|
|Minimum supported server||Windows Server 2008|