cancel
Showing results for 
Search instead for 
Did you mean: 

Bulk update User details

Former Member
0 Kudos

Hi

I wondering if there is a way to bulk update User details to untick the option "User must change password at next logon".

We have 600 odd users imported into our 4.1 environment who all have this option ticked and is causing issues with trusted authentication.

I have looked at this post http://scn.sap.com/community/bi-platform/java-sdk/blog/2013/05/14/scripts-for-user-management but looking through options available, I am not confident, however hoping someone will be able to help

Regards

Ross

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I believe this script seems to work by unticking the change password on next login option

<%@ page import = "com.crystaldecisions.sdk.exception.SDKException,
com.crystaldecisions.sdk.framework.*,
com.crystaldecisions.sdk.occa.infostore.*,
com.crystaldecisions.sdk.occa.report.*,
com.crystaldecisions.sdk.properties.*,
com.crystaldecisions.sdk.plugin.desktop.user.*,
java.util.*"
%>

<%
// User Credentials
String username = "Administrator";
String password = "";
String cmsname  = "Server";
String authType = "secEnterprise";

// Set to true to disable all users, false to enable all users
Boolean changePassword = false;

IEnterpriseSession enterpriseSession = null;
IInfoStore infoStore;
IInfoObjects boInfoObjects;

// Log onto Enterprise
enterpriseSession = CrystalEnterprise.getSessionMgr().logon(username, password, cmsname, authType);
infoStore = (IInfoStore)enterpriseSession.getService("", "InfoStore");

// The SI_ID to start at when searching
int max_id = 0;
for(;;) {
// Loop through all users - excluding Administrator and Guest
boInfoObjects = (IInfoObjects)infoStore.query("Select * FROM CI_SYSTEMOBJECTS WHERE SI_Kind='User' AND SI_NAME!= 'Administrator' and SI_NAME !='Guest' AND SI_ID > " + max_id + " ORDER BY SI_ID ASC");

// If there are no more objects then we're done.
if(boInfoObjects.size() == 0)
break;

for(Iterator boCount = boInfoObjects.iterator() ; boCount.hasNext() ; ) {
  IUserBase boObject = (IUserBase)boCount.next();
boObject.setPasswordToChangeAtNextLogon(changePassword);
out.println("current password change status is: " + boObject.isPasswordToChangeAtNextLogon());

  max_id = max_id + 1;
}
infoStore.commit(boInfoObjects);

}
out.println("Completed</br>");

%>