cancel
Showing results for 
Search instead for 
Did you mean: 

Import Users with Password Disabled

Former Member
0 Kudos

I would like to do a mass import of users through the import functionality in the SAP Portal User Management Engine. i would like their password to be disabled (The password disabled radio button needs to be checked). How do i do that?

Thank you for your help.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi, I don't think you can do this "out of the box". My suggestion would be to import them normally then write a custom component to change that property automatically. The only properties you can upload are as follows: http://help.sap.com/saphelp_nw04s/helpdata/en/7d/49ae0771924cf4a1fc7e2af7b2e18c/content.htm

Hope this helps,

Simon

Former Member
0 Kudos

Is there a property in the visual admin or config tool that will change the default radio button from "initial password" to "disabled password"? That way, when the administrator creates a user (either manually or through import), tha password radio button will always be marked as disabled by default.

I will appreciate your help with this.

Also, if you have any documetation on the custom component that you referred to (like where to call the component from...etc), that will be helpful too.

Thank you.

Former Member
0 Kudos

Hi,

I really cannot find any way to set this in the configuration. Here is some code that would do it programatically for a list of users:

package au.com.plaut.pct;
 
import com.sapportals.portal.prt.component.*;
import com.sap.security.api.IUserAccountFactory;
import com.sap.security.api.UMFactory;
import com.sap.security.api.IUserAccount;

public class SetPasswordDisabled extends AbstractPortalComponent
{
    public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
    {
		
		try {
		
		String s_users = request.getParameter("users");
		String[] a_users = s_users.split(";");
		boolean status = false;
		String user = "";
		
		for (int i=0; i<a_users.length;i++) {
			user = a_users<i>;
			IUserAccountFactory uaf = UMFactory.getUserAccountFactory();
			IUserAccount ua = uaf.getUserAccountByLogonId(user);
			ua = uaf.getMutableUserAccount(ua.getUniqueID());
			
			if (ua != null) {
				
				if (!ua.isPasswordDisabled()) {
					ua.setPasswordDisabled();	
					ua.commit();
					response.write("<br>User " + user + " Password has been disabled: " + ua.isPasswordDisabled());
				} else {
					response.write("<br>User password was already disabled");
				}
				
			} else {
				response.write("<br>User " + user + " is null");
			}
		}
		
		}
		catch (Exception e) {
			response.write("<br>" + e.toString());
		}
		
    }
}

If you like I can send you the component that you can run on your system. Just let me know your email.

BRgds,

Simon

Former Member
0 Kudos

Thank you for your response.

Sure, I would like to have the component.

Also, since i am not a developer, I have couple of questions that you may be able to help me with:

1. How do i run the component? Should i make an iView that points to the component?

2. The code you provided seems to disable the password for all users. We actually would like to disable the password for all users whose data source is ldap except for one user. How do i achieve that?

Thanks again for your help.

- Ghizlane Idrissi

Former Member
0 Kudos

No worries I will send you the component with instructions on how to run it. I have made the component very quickly but you can limit the users it changes by just passing in a string in URL. I will explain that too.