cancel
Showing results for 
Search instead for 
Did you mean: 

mass change of email addresses in IdM

youssef_anegay3
Explorer
0 Kudos

Hello all

we have an IdM 7.2 SP9, and i would like to know how i can mass change the e-mail adresses of my users, to make it effective in all the systems i have connected to IdM (ABAPs, JAVAs, HANAs, etc ...)

What i would like to do is change the e-mail adressof all my users from : xxx@company1.com to xxx@company2.com for example

Is that feasible? any advices?

Of course i can always do it manually user per user base ... But is there an automated way to do it ?
Thanks in advance for you help

BR

Y.

Accepted Solutions (1)

Accepted Solutions (1)

Ckumar
Contributor
0 Kudos

Hello Youssef,

Yes it is feasible and there are several way to achieve this.

  • You can write a on-demand job with a To Identity Store Pass. In that pass you can write a SQL query in source tab to read all user's MSKEYVALUE and Mail address. In Destination pass, you can update the user mail address by using a simple script which will replace @compny1.com with company2.com

  • Alternate way to achieve this is to write a on-demand job with to passes - first is From Ascii Pass and second is To Identity Store pass. In this case you need to pass all the user's mskeyvalue and new email address in text file.


P.S. - After writing the on-demand job, first test it for 1-2 users then go for mass-update.


Regards,

C Kumar

youssef_anegay3
Explorer
0 Kudos

hello Kumar

i like your first proposal ... but is there any documentation on how to set that up?

Ckumar
Contributor
0 Kudos

Hello Youssef,

I don't think that there is any documentation available regarding this however it is quite easy as just you need to write one on-demand job with one pass (If you want to follow the first approach).

Query in source should be like (replace USER with mskeyvalue of the user for which you want to test first)

select

  b.mcvalue as mskeyvalue,

  c.mcvalue as mail

from idmv_vallink_basic a,

  idmv_vallink_basic b,

  idmv_vallink_basic c

where a.mcAttrName='MX_ENTRYTYPE'

and a.mcvalue='MX_Person'

and b.mcAttrName='MSKEYVALUE'

and c.mcAttrName='MX_MAIL_PRIMARY'

and a.mskey=b.mskey

and b.mskey=c.mskey

and b.mcsearchvalue like 'USER'

while script should be like-

// Main function: z_change_mail_address

function z_change_mail_address(Par){

  //Example calling DSE internal function

  //uStop("Terminated by user");

  var oldMail = Par;

  //uErrMsg(1,"Old Mail Address: " +oldMail);

  var newMail = oldMail.replace("@xyz.com", "@abc.com");

  //uErrMsg(1,"New Mail Address: " +newMail);

  return newMail.toUpperCase();

}

Hope it will help.

Regards,

C Kumar

Steffi_Warnecke
Active Contributor
0 Kudos

Woah Kumar,

that's a pretty complicated SQL statement for the quite simple data pool in the source tab.

I just use this:


select mcmskey as mskey from idmv_entry_simple where mcentrytype = 'MX_PERSON' and 

mcmskey in (select distinct mskey from idmv_value_basic where attrname = 'MX_MAIL_PRIMARY')

and mcmskey = <mskey of testuser>

Get me every person with an email address (for example here). And in my script in the destination tab I use the internal "uReplaceString" function.

@Youssef: You'll find documentation on the function in the IDM help of the MMC. So feeding it with the needed parameters should be easy then.

Regards,

Steffi.

jaisuryan
Active Contributor
0 Kudos

Hi Steffi,

Above SQL doesnt fetch email address to do the string manipulation.

Hi Youssef,

The Source SQL can be more simpler as below,

select mskey, searchvalue from idmv_value_basic with(nolock) where attrname = 'MX_MAIL_PRIMARY'

Destination tab be like,

MSKEYVALUE = %MSKEYVALUE%

changetype = Modify

MX_MAIL_PRIMARY = $FUNCTION.z_change_mail_address(%searchvalue%)$$

Note: make sure you check "Use Identity Store" check box in source tab and select appropriate IDS.

Kind regards,

Jai

Steffi_Warnecke
Active Contributor
0 Kudos

Hey Jai,

I don't need the email value in the source. My destination looks like this:


MSKEYVALUE = %MSKEYVALUE%

MX_MAIL_PRIMARY = $FUNCTION.isv_replaceCharacter(%MX_MAIL_PRIMARY%!!<search for>!!<replace by>)$$

And to make my life easier, I use job constants for the attributename, <search for> and <replace by>, so I can switch it around faster.

That means, I have 3 parameters in the script, but this way, it's easy to re-use the job. And you don't need to change a thing in the job settings, just the job constants.

But I guess, we all have our preferences.

Regards,

Steffi.

Answers (3)

Answers (3)

youssef_anegay3
Explorer
0 Kudos

Works like a charm ! thanks all !

youssef_anegay3
Explorer
0 Kudos

Hello all

thanks for your answers ... I will try that.

If I get it right, the difference betwenn the two methods is that the first one will do the research, and the replace in the same action. For the second method, i have to provide the text file with all the users and passwords, and then the second step will update it? is that right ?

Y.

Steffi_Warnecke
Active Contributor
0 Kudos

Hello Youssef,

with the exception, that you need "the users and email addresses" (not passwords, but I bet that was a typo), you're right.

The second approach is good, when the changes are all over the place (like not just changing to one new email address, but to change some addresses to "@company12.com" and some to "@company14.com" etc). Then it is easier to just create a file with all the new values and overwrite the current values.

Regards,

Steffi.

Ckumar
Contributor
0 Kudos

Hello Youseef,


As already explained by Steffi, Second approach is good only when the replacement is not constant for all the emails.


If your problem got resolved then please share/mark the correct answer and close this thread,


Regards,

C Kumar

youssef_anegay3
Explorer
0 Kudos

yep typo error sorry ... it was indeed the emails. I have to change all emails to all of my users. . It is a one shot operation. So i guess second solution suits best ?

youssef_anegay3
Explorer
0 Kudos

it is a one shot operation to change the email adresses of all the users in IdM ... second solution then ?

Ckumar
Contributor
0 Kudos

Hello Youseef.

The first solution is best (one shot operation) when you want to change all user's email address from user1@xyz.com to user1@abc.com.

The second solution is best when the requirement is to change email address to different value for different users.

for example -

user1@xyz.com to user1@abc.com

user2@wxyz.com to user2@abcd.com

user3@xyz.com to user1@mnp.com

in this case you have to pass all user's data like below in text file in TO ASCII FILE

Mskeyvalue;oldEmailAddress;Newmail addree

user1;user1@xyz.com;user1@abc.com

user2;user2@wxyz.com;user2@abcd.com

user3;user3@xyz.com;user3@mnp.com

Regards,

C Kumar

youssef_anegay3
Explorer
0 Kudos

Oh ok ... i understood it wrong then ... thanks!

former_member198652
Active Participant
0 Kudos

Hi Youssef,

The best option(I prefer) is as suggested by C Kumar

on-demand job with to passes - first is From Ascii Pass and second is To Identity Store pass. In this case you need to pass all the user's mskeyvalue and new email address in text file.


Here get all the user's Mskeyvalues  and new email address and store in Temp table in the From ASCII pass.And in To IDS pass in the source tab, get all all the mskeyvalues from temp table, which are stored in previous pass and in Destination set mail with  Replace option {R} followed by mail attribute.

It is always recommended to test for 1 or 2 users ids, before implementing for whole user.


Regards,

Jaya