- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2016 06:43 AM
Hello Experts,
I am trying to import user data using import sets from xls file. I am using a script in the transform map variable mapping to generate password but that's not working. Could you please suggest, where I am doing wrong?
Script
var FN = source.u_first_name.toString();
var LN = source.u_last_name.toString();
var firstLength=FN.length;
var secondLength=LN.length;
target.user_password=FN.charAt(0).toUpperCase()+firstLength+FN.charAt(firstLength-1)+LN.charAt(0).toUpperCase()+secondLength+LN.charAt(secondLength-1);
Also attaching transform map screen shots FYR.
Thanks
Pavan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2016 01:17 AM
Guys,
The below script works for setting password using script while importing user profiles from import sets.
var FN = source.u_first_name.toString();
var LN = source.u_last_name.toString();
var firstLength=FN.length;
var secondLength=LN.length;
var pwd=FN.charAt(0).toUpperCase()+firstLength+FN.charAt(firstLength-1).toLowerCase()+LN.charAt(0).toUpperCase()+secondLength+LN.charAt(secondLength-1).toLowerCase();
answer=pwd;
Not sure why they are using answer!!! Below link will helpful.
http://www.snc-blog.com/2013/11/05/importing-users-with-password/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2016 07:20 AM
Hi Nagidi,
What you are doing is correct and will import the data as per the script. As password field is an encrypted data type, it will appear as empty, but the data will be stored.
If you want to test, you can logout and try to login by using your logic for password.
Thanks and regards,
Swamy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2016 07:57 AM
Hi Swamy,
Tried the same, but thats not working.
Thanks
Pavan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2016 12:50 AM
Hi Pavan,
When you say "I am using a script in the transform map variable mapping to generate password but that's not working."
What symptoms do you see that lets you know it is not working?
I would suggest that you test by importing just for one user, and initially try with a a fixed string, say "MyPassword275232" assigned to target.user_password.
once you can log in with "MyPassword275232", you could then move on to auto generate passwords, for one user.
Actually first step might be to check for the specific user you can log in with a manually, from the GUI, assigned password.
There are a few possible causes of that not working, user locked out, user not active, authentication taking place via LDAP, which could be eliminated by a quick test.
Best Regards
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2016 06:05 AM
Thank you Tony, for getting back to me.
Will try that out and keep you posted.
Thanks
Pavan