@depends(_HAS_WIN32TS_DEPENDENCIES)
def logoff_session(session_id):
 try:
  win32ts.WTSLogoffSession(win32ts.WTS_CURRENT_SERVER_HANDLE, session_id, True)
 except PyWinError as error:
  _LOG.error('Error calling WTSLogoffSession: %s', error)
  return False
 return True

@ depends ( _HAS_WIN32TS_DEPENDENCIES ) def logoff_session ( session_id ) : try : win32ts . WTSLogoffSession ( win32ts . WTS_CURRENT_SERVER_HANDLE , session_id , True ) except PyWinError as error : _LOG . error ( 'Error calling WTSLogoffSession: %s' , error ) return False return True
initiate the logoff of a session .