On another thread I asked How do I create and new enterprise alias?
I was directed to the following SAP Note...
http://service.sap.com/sap/support/notes/1804839
I was able get things working and create enterprise aliases for all of my Windows AD users that don't already have one. The reason I am doing this is so that when they get removed from the active directory group and subsequently BusinessObjects their corresponding inbox, personal folder and any schedules they may have created do not get removed.
So my question is this. Is there any way to create an enterprise alias disabled by default? Here is the code snippet downloaded from the aforementioned note.
I would like to add a line after user.setNewPassword (line #91) that says something like this...
user.setEnabled(false);
However, that isn't working. The method setEnabled is not recogized. I did check the documentation for IUser and cannot find any method to disable an enterprise user. Does such a method exist?
Thanks,
Noel
for(Iterator iuser = users.iterator() ; iuser.hasNext() ; ) {
IUser user;
IUserAliases userAliases;
boolean isAD;
boolean hasEnterprise;
user = (IUser) iuser.next();
userAliases = user.getAliases();
isAD = false;
hasEnterprise = false;
for(Iterator ialias = userAliases.iterator() ; ialias.hasNext() ; ) {
IUserAlias userAlias;
String authentication;
userAlias = (IUserAlias) ialias.next();
authentication = userAlias.getAuthentication();
isAD = "secWinAD".equals(authentication);
hasEnterprise = "secEnterprise".equals(authentication);
}
if(isAD && !hasEnterprise) {
out.println("'" + user.getTitle() + "' - adding Enterprise Alias.<BR>");
userAliases.addNew("secEnterprise:" + user.getTitle(), false);
user.setNewPassword("Password123");
need_to_update = true;
}
min_id = user.getID();
}