EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB6998: How to disconnect users in MicroStrategy Intelligence Server SDK 9.x and 10.x


Community Admin

• Strategy


This article discusses how to disconnect users in MicroStrategy Intelligence Server SDK 9.x and 10.x

In Strategy Desktop 9.x and 10.x, users with administrator privilege can disconnect other users from the user connection monitor.

ka04W000000Ogd6QAC_0EM440000002H1H.gif

 
Individual user session will be closed once the session is highlighted and the 'Delete' button is clicked.
 
Strategy API call IDSSServerAdmin::CloseUserSession is the one to use to implement the function.
 
IDSSServerAdmin::CloseUserSession
This method closes the user session from a project. The project is identified by the ServerContextID. Each project loaded into a server is identified by a server context ID which is basically a sequential number starting from 0. When the ServerContextID is -1, which is the default, this method closes the user session from all projects.
 


HRESULT CloseUserSession( 
	BSTR SessionID, 
	long ServerContextID 
);

 
 
In Parameters:

  • SessionID: ID of the user session
  • ServerContextID: The server context ID used to identify a project loaded in the server.

Out Parameters:
None
 
Return Values:
S_OK
 
The following is a sample code that demonstrates how to display the current user sessions and how to delete one of them using the API call above.
 


'-------------------------------------------------------------------------- 
' Create a new DataSource 

Dim MyDataSource As New DSSDataSource 
MyDataSource.name = "DataSourceName1" 
MyDataSource.Type = DssDataSourceTypeServer 
MyDataSource.Location = "APS_SDK" 
MyDataSource.Mode = DssConnectionModeServerAccess 

'-------------------------------------------------- 
' Login into Data Source ... 

MyDataSource.AuthMode = DssAuthStandard 
MyDataSource.login = "realadmin" 
MyDataSource.Passwd = "" 
MyDataSource.Init 

'-------------------------------------------------- 
' Create a session object. 

Dim objsession As IDSSSession 
Set objsession = MyDataSource.CreateSession 
''Set MySource = MySession.ObjectSource 
Dim objMysession As IDSSSession 

''Set objMysession = objProjDS.CreateSession 

'----------------------------------------------------- 
'create a ServerAdmin Session 

Dim objMyserveradmin As IDSSServerAdmin 
Set objMyserveradmin = objsession.ServerAdmin 

Dim i, sessionID, listsessionID, name 
For i = 1 To objMyserveradmin.UserSessions(DssServerRefreshSynch).Count 
  listsessionID = objMyserveradmin.UserSessions(DssServerRefreshSynch).Item(i).sessionID 
  name = objMyserveradmin.UserSessions(DssServerRefreshSynch).Item(i).name 
  MsgBox listsessionID & " " & name 
  If name <> "realadmin" Then 
    sessionID = listsessionID 
  End If 

Next 

Call objMyserveradmin.CloseUserSession(sessionID)

 
  
CUSTOMIZATION WARNING
This customization is provided as a convenience to Strategy users and is only directly applicable to the version stated. While this code may apply to other releases directly, Strategy Technical Support makes no guarantees that the code provided will apply to any future or previous builds. In the event of a code change in future builds, Strategy Technical Support makes no guarantee that an updated version of this particular customization will be provided. In the event of a code change in future builds, Strategy may not be able to provide additional code on this matter even though this customization is provided at this time for this specific build. For enhancements to this customization or to incorporate similar functionality into other versions, contact your Account Executive to inquire about Strategy Consulting assistance.
 
 
 
 


Comment

0 comments

Details

Knowledge Article

Published:

June 13, 2017

Last Updated:

June 13, 2017