How can we reset user password in bulk?
search cancel

How can we reset user password in bulk?

book

Article ID: 272168

calendar_today

Updated On:

Products

CA Identity Manager

Issue/Introduction

Can we create Identity Manager's admin task to reset password for multiple users in bulk?

 

Environment

Release : Identity Manager 14.4.x

Resolution

The approach to process multiple reset user password is usually utilizing Bulk Loader functionality in IM with (Policy Xpress) PX Policy that generates random password and send notification email.

Please do the following.

1. On your bulkloader client machine, add 'reset' action to map to the default 'Reset User Password' task in actionToTaskMapping parameter in imbulkloadclient.properties (by default it is under C:\Program Files\Virtual Appliance Tools\CA-IM_BulkLoadClient\conf directory on Windows)

    actionToTaskMapping=reset.Reset User Password;create.Create User;modify.Modify User;delete.Delete User

2. Create the PX Policy similar to the following

In XML

<ManagedObject type="POLICY XPRESS EXPORT" friendlyName="PXRandomPasswordGenerator">
        <Attribute name="friendlyName">PXRandomPasswordGenerator</Attribute>
        <Attribute name="enabled">true</Attribute>
        <Attribute name="category">custom</Attribute>
        <Attribute name="description">PXPolicy to generate random password for Password Reset</Attribute>
        <Attribute name="runOnce">false</Attribute>
        <Attribute name="priority">0</Attribute>
        <Attribute name="type">TASK</Attribute>
        <Attribute name="system">false</Attribute>
        <Attribute name="template">PolicyXpress</Attribute>
        <Attribute name="templateData"></Attribute>
        <Attribute name="whenToRun"><![CDATA[<Related>
<WhenToRun>
<Attribute name="type">TASK</Attribute>
<Attribute name="step">SET_SUBJECT</Attribute>
<Attribute name="eventName">ResetUserPassword</Attribute>
</WhenToRun>
</Related>
]]></Attribute>
        <Attribute name="dataElements"><![CDATA[<Related>
<DataElement>
<Attribute name="friendlyName">randomPwd</Attribute>
<Attribute name="elementType">element.type.random.values</Attribute>
<Attribute name="subElement">element.random.string</Attribute>
<Attribute name="priority">0</Attribute>
<PxParameter extraInfo="" index="1" uiType="TYPED">8</PxParameter>
</DataElement>
<DataElement>
<Attribute name="friendlyName">userEmailAddress</Attribute>
<Attribute name="elementType">element.type.user.attribute</Attribute>
<Attribute name="subElement">element.user.attribute.get</Attribute>
<Attribute name="priority">1</Attribute>
<PxParameter extraInfo="" index="1" uiType="SELECTED">%EMAIL%</PxParameter>
</DataElement>
<DataElement>
<Attribute name="friendlyName">userFullName</Attribute>
<Attribute name="elementType">element.type.user.attribute</Attribute>
<Attribute name="subElement">element.user.attribute.get</Attribute>
<Attribute name="priority">2</Attribute>
<PxParameter extraInfo="" index="1" uiType="SELECTED">%FULL_NAME%</PxParameter>
</DataElement>
</Related>
]]></Attribute>
        <Attribute name="entryRules"><![CDATA[<Related>
<EntryRule>
<Attribute name="friendlyName">emailExist.entryrules</Attribute>
<Attribute name="priority">0</Attribute>
<Attribute name="description"/>
<Conditions>
<Condition>
<Attribute name="dataElement">userEmailAddress</Attribute>
<Attribute name="operator">CONTAINS</Attribute>
<Attribute name="value">@</Attribute>
</Condition>
</Conditions>
</EntryRule>
</Related>
]]></Attribute>
        <Attribute name="actionRules"><![CDATA[<Related>
<ActionRule>
<Attribute name="friendlyName">setRandomPassword.actionrule</Attribute>
<Attribute name="priority">0</Attribute>
<Attribute name="description"/>
<Conditions/>
<AddActions>
<ActionElement>
<Attribute name="friendlyName">setRandomPassword.action</Attribute>
<Attribute name="actionType">action.name.set.user.values</Attribute>
<Attribute name="subAction">action.user.attribute.set</Attribute>
<Attribute name="priority">0</Attribute>
<PxParameter extraInfo="" index="1" uiType="SELECTED">%PASSWORD%</PxParameter>
<PxParameter extraInfo="" index="2" uiType="TYPED">{'randomPwd'}</PxParameter>
</ActionElement>
<ActionElement>
<Attribute name="friendlyName">setRandomPasswordConfirm.action</Attribute>
<Attribute name="actionType">action.name.set.user.values</Attribute>
<Attribute name="subAction">action.user.attribute.set</Attribute>
<Attribute name="priority">1</Attribute>
<PxParameter extraInfo="" index="1" uiType="SELECTED">|passwordConfirm|</PxParameter>
<PxParameter extraInfo="" index="2" uiType="TYPED">{'randomPwd'}</PxParameter>
</ActionElement>
<ActionElement>
<Attribute name="friendlyName">sendNotificationEmail.action</Attribute>
<Attribute name="actionType">action.name.send.mail</Attribute>
<Attribute name="subAction">action.mail.mail</Attribute>
<Attribute name="priority">2</Attribute>
<PxParameter extraInfo="" index="1" uiType="TYPED">{'userEmailAddress'}</PxParameter>
<PxParameter extraInfo="" index="2" uiType="TYPED"/>
<PxParameter extraInfo="" index="3" uiType="TYPED"/>
<PxParameter extraInfo="" index="4" uiType="TYPED">Password Reset Notification</PxParameter>
<PxParameter extraInfo="" index="5" uiType="TYPED">Dear {'userFullName'}, &lt;br&gt;&lt;br&gt;&#13;
&#13;
&#13;
Your password has been reset to &lt;br&gt;&#13;
&#13;
{'randomPwd'} &lt;br&gt;&lt;br&gt;&#13;
&#13;
Please login and reset with a new password.&lt;br&gt;&lt;br&gt;&#13;
&#13;
Regards,&lt;br&gt;&#13;
IM Admin</PxParameter>
<PxParameter extraInfo="" index="6" uiType="TYPED"/>
</ActionElement>
</AddActions>
<RemoveActions/>
</ActionRule>
</Related>
]]></Attribute>
</ManagedObject>

3. On your bulkloader client machine, create the CSV data file for the users you want the password to be reset. E.g. create C:\Program Files\Virtual Appliance Tools\CA-IM_BulkLoadClient\samples\resetpwd.csv file with the following content

action,uid,|forcePasswordReset|
reset,exampleUser01,true
reset,exampleUser02,true
reset,exampleUser03,true

4. Run the bulkloader client

C:\Program Files\Virtual Appliance Tools\CA-IM_BulkLoadClient\bin>imbulkloadclient.bat --format CSV --inputFile ..\samples\resetpwd.csv
Picked up JAVA_TOOL_OPTIONS: "-Dos.name=Windows Server 2016"
IM Bulk Loader invoked ...
deobfuscateWSSPassword set to true!
Loaded configuration options from properties file: ../conf/imbulkloadclient.properties
Input file name: ..\samples\resetpwd.csv
Input file format: CSV
Transformation of input file finished successfully
Server URL: http://xxx.xxx.xxx.xxx:8080/iam/im/TEWS6/identityEnv
Submitting all records in one request ...
WARN  23-08 14:30:23,322 - Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
Finished successfully - Transaction ID: e3b849b7-XXXXXX-XXXXXXXXXX-09c1e

5. Check in View Submitted Task

6. Check the email notification received by each user