|
TerminalServicesHelperWTSLogoffSession Method |
Namespace: Xcalibur.NativeMethods.V2.TerminalServicesAssembly: Xcalibur.NativeMethods.V2 (in Xcalibur.NativeMethods.V2.dll) Version: 1.0.1.0
Syntax [DllImportAttribute("wtsapi32.dll", SetLastError = true)]
public static bool WTSLogoffSession(
IntPtr serverHandle,
int sessionId,
bool wait
)
<DllImportAttribute("wtsapi32.dll", SetLastError := true>]
Public Shared Function WTSLogoffSession (
serverHandle As IntPtr,
sessionId As Integer,
wait As Boolean
) As Boolean
public:
[DllImportAttribute(L"wtsapi32.dll", SetLastError = true)]
static bool WTSLogoffSession(
IntPtr serverHandle,
int sessionId,
bool wait
)
[<DllImportAttribute("wtsapi32.dll", SetLastError = true)>]
static member WTSLogoffSession :
serverHandle : IntPtr *
sessionId : int *
wait : bool -> bool
Parameters
- serverHandle IntPtr
- A handle to an RD Session Host server opened by a call to the
or WTSOpenServerEx function, or specify
WTS_CURRENT_SERVER_HANDLE to indicate the RD Session Host server on which your application
is running.
- sessionId Int32
- A Remote Desktop Services session identifier. To indicate the
current session, specify WTS_CURRENT_SESSION. To retrieve the identifiers of all sessions
on a specified RD Session Host server, use the WTSEnumerateSessions function.
To be able to disconnect another user's session, you need to have the Disconnect
permission. For more information, see Remote Desktop Services Permissions. To modify
permissions on a session, use the Remote Desktop Services Configuration administrative tool.
To disconnect sessions running on a virtual machine hosted on a RD Virtualization Host
server, you must be a member of the Administrators group on the RD Virtualization Host
server.
- wait Boolean
- Indicates whether the operation is synchronous.
Return Value
BooleanIf the function succeeds, the return value is nonzero. To determine whether the
function adjusted all of the specified privileges, call
.
See Also