Posts

Get User and Users Manager record in single query from the same table

Below query gives you user XXXXXX record and XXXXXX manager records ie total 2 rows from the table hr_source select hrview.userName,hrview.firstName,hrview.lastName,hrview.email,hrview.employeeNumber,hrview.supervisor from hr_source hrview where hrview.employeeNumber in( select hrview1.supervisor from hr_source hrview1 WHERE hrview1.userName='XXXXXX' ) UNION select hrview1.userName,hrview1.firstName,hrview1.lastName,hrview1.email,hrview1.employeeNumber,hrview1.supervisor from hr_source hrview1 WHERE hrview1.userName='XXXXXX'

Searching users based on custom attribute

import sailpoint.object.Identity; import sailpoint.object.QueryOptions; import sailpoint.object.Filter;   import java.util.*; QueryOptions qo = new QueryOptions(); qo.addFilter(Filter.eq("location",”Bangalore”)); // Search users based on two identity attributes //QueryOptions qo = new QueryOptions();                          //Filter f1=Filter.eq("firstname",firstName) ;    //Filter f2 = Filter.eq("lastname",lastName); //Filter finalFilter = Filter.and(f1,f2); //qo.addFilter(finalFilter); Iterator users = context.search(Identity.class, qo); while (users.hasNext()) { Identity user = (Identity)users.next(); System.out.println("\nUserName: " + user.getName()); System.out.println("\nEmployee ID: " + user.getAttribute("empId")); }

Get list of Identities that are provisioned to particular application

Actually the below code gives you the list of Links/accounts provisioned to a particular application, anyway you can find users using link import sailpoint.object.Identity; import sailpoint.object.QueryOptions;   import sailpoint.object.Link;   import sailpoint.object.Filter;   QueryOptions qo = new QueryOptions(); qo.add(Filter.eq("application.name", "HR System")); Iterator accountLinks = context.search(Link.class, qo); while (accountLinks.hasNext()) { Link link = (Link)accountLinks.next();           // use link object to find user and add to List }

Change Column header in Delimited File Application using buildmap rule

The below code is used to change the column header during delimited file aggregation. Suppose, you have 'SuperUser' column in delimited file and you want to show this in Sailpoint as 'AccountID'. Write the below code in buildmap rule. import sailpoint.connector.DelimitedFileConnector; HashMap map = DelimitedFileConnector.defaultBuildMap(cols,record); String SuperUser = map.get("SuperUser"); map.put( "AccountID", SuperUser ); return map;

Generate password using password policy for identity during HR System aggregation

Use Password Policy tab in the Application for creating password policy, specify the conditions and create the policy. Use the below code to set random password(using policy) to the identity in Creation rule. import sailpoint.object.Identity; import sailpoint.object.PasswordPolicy; import sailpoint.api.PasswordGenerator; String policyName = “YOUR PASSWORD POLICY NAME"; PasswordPolicy policy = context.getObjectByName(PasswordPolicy.class, policyName); String password = new PasswordGenerator(context).generatePassword(policy); identity.setPassword(password);