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

KB8495: How to delete a user and user profile through Microstrategy Intelligence Server SDK


Community Admin

• Strategy


To delete a user through the MicroStrategy Intelligence Server Software Development Kit (SDK), an administrator can use the following Microstrategy Intelligence Server Application Program Interface (API) method.

To delete a user through the Strategy Intelligence Server Software Development Kit (SDK), an administrator can use the following Strategy Intelligence Server Application Program Interface (API) method:
 
IDSSUserAcctSvcs::DeleteUser.
This method deletes an object from the collection by specifying either the project's DSS_ID or an IDSSProject pointer.
 
HRESULT DeleteUser(
IDSSUser* pUser,
long Flags
);
Similarly, to delete a user profile, Administrators must use the Strategy Intelligence Server API method:
 
IDSSUserAcctSvcs::DeleteUserProfile.
HRESULT DeleteUserProfile(
IDSSProject* pProject,
IDSSUser* pUser,
long Flag
);
The Visual Basic code for this is as follows:
 
Dim MyDataSource As New DSSDataSource
Dim MySource As IDSSSource
' Login to IServer
MyDataSource.Name = "YOUR_SERVER_NAME"
MyDataSource.Type = DssDataSourceTypeProjectMD7
MyDataSource.Location = "YOUR_SERVER_NAME"
MyDataSource.Mode = DssConnectionModeServerAccess
MyDataSource.Port = 0
MyDataSource.AuthMode = DssAuthStandard
MyDataSource.login = "Administrator"
MyDataSource.Passwd = ""
MyDataSource.ProjectName = "Tutorial"
MyDataSource.Init
Dim oSession As IDSSSession
Set oSession = MyDataSource.CreateSession
Set MySource = oSession.Component(DssRoleObjectSource)
' Find the user
Dim oUser As IDSSUser
Dim user_search As IDSSSearch
MySource.NewObject (DssTypeSearch)
Set user_search = MySource.NewObject(DssTypeSearch)
user_search.NamePattern = "User"
user_search.Domain = DssSearchRepository
Set oUser = user_search.Execute.Item(1)
' Find the project
Dim oProjectList As DSSDataSourceEnumerator
Dim oProjectID As DSSDataSource
Dim oProjectName As String
Dim oProject As IDSSProject
Set oProjectList = MyDataSource.Enumerator
Set oProjectID = oProjectList.Item(1)
'oProjectName = oProjectID.Name
Set oProject = oProjectID
' Delete the user
Call oSession.ClientServices.UserAcctSvcs.deleteuser(oUser)
Call oSession.ClientServices.UserAcctSvcs.DeleteUserProfile(oProject, oUser)
' Close Session
MyDataSource.Reset
Code 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 may not be able to provide additional code on this matter even though this customization is provided at this time for this specific build.
 


Comment

0 comments

Details

Knowledge Article

Published:

June 22, 2017

Last Updated:

June 22, 2017