Click to Rate and Give Feedback
MSDN
MSDN Library
System Services
IWTSSBPlugin
Methods
 IWTSSBPlugin::WTSSBX_GetMostSuitabl...
IWTSSBPlugin::WTSSBX_GetMostSuitableServer Method

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.

Syntax

C++
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 TS Session Broker that the user is connecting to.

pMachineId [in, out]

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.

Return Value

Returns S_OK if successful.

Remarks

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.

Requirements

Minimum supported clientWindows XP
Minimum supported serverWindows Server 2008
HeaderTssbx.h
IDLTssbx.idl
IIDIID_IWTSSBPlugin is defined as DC44BE78-B18D-4399-B210-641BF67A002C

See Also

IWTSSBPlugin

Send comments about this topic to Microsoft

Build date: 10/19/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker