Delete users from IBM Connections when you have only the Display Name

  • 27 Jun, 2014

A few days ago i was in charge do remove some users from IBM Connections. The case was  to delete the inactivated users.

The users was removed from the corporate LDAP a few months ago and no one know the DN or CN of the users. The only information was the Display Name

I need to know the user_dn and user_uid  to create the file delete_or_inactivate_employees.in and then run delete_or_inactivate_employees.sh script.

The only way i found was to export some data from PEOPLEDB. Reading the table EMPINST . Inactivated users does not have the PROF_MAIL data.

I created an java program using Eclipse, connect to PEOPLEDB and export all users without the PROF_MAIL.

I was able to see the user list and compare with the display name.

The java program print the results on eclipse console.

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class DAO {

public static void main(String[] args) {
        String jdbcClassName=“com.ibm.db2.jcc.DB2Driver”;
        String url=“jdbc:db2://mydb2server:50000/PEOPLEDB”;
        String user=“lcuser”;
        String password=“password”;

        Connection connection = null;
try {
            //Load class into memory
            Class. forName(jdbcClassName);
            //Establish connection
            connection = DriverManager. getConnection(url, user, password);

            Statement stmt = connection.createStatement();
            ResultSet rs = stmt.executeQuery(“SELECT PROF_UID, PROF_SOURCE_UID, PROF_DISPLAY_NAME FROM “EMPINST”.“EMPLOYEE” WHERE PROF_MAIL IS NULL“);
while (rs.next()){
                    String x = rs.getString(“PROF_SOURCE_UID”);
                    String y = rs.getString(“PROF_UID”);
                    System. out.println (“$dn:”+x);
                    System. out.println(“uid:”+y);
                    System. out.println(“.”);
            }
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        } finally{
if(connection!= null){
                System. out.println(“Exported successfully.”);
try {
                    connection.close();
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
        }

    }

}

Related Posts

Homepage Search: Profiles server fails while creating the initial index

  • 10 Sep, 2013

When trying to create the initial index for Global Search from the Homepage server, the index update fails with an error. To prevent further problems with indexing, perform a search in the Profiles database for any null entries in the table EMPINST.EMPLOYEE. select \ from EMPINST.EMPLOYEE
where EMPINST.EMPLOYEE.PROF\DISPLAY\NAME is null If any entries are returned they must be updated with an entry in the display name column for the Profiles feature to index successfully. To prevent this issue from occurring, change the value of PROF\DISPLAY\NAME=256 in the validate\dbrepos\fields.properties file, to contain the following: PROF\DISPLAY\NAME=(x != null) && (x.length() > 0) && (x.lengt

Homepage Search: Profiles server fails while creating the initial indexRead More

Proud to be an HCL Ambassador 2021

  • 15 Dec, 2020

​If you have a problem, and no-one else can help, and if you can find them, maybe you can ask an HCL Ambassador… !(http://www.mysphere.com.br/wp-content/uploads/2020/12/HCLAmbassaborlight4x.png) See the HCL Ambassadors Class of 2021(https://hcltechsw.com/about/hcl-ambassadors/class-of-2021)

Proud to be an HCL Ambassador 2021Read More

Nominate an IBM Champion

  • 30 Oct, 2019

IBM Champions demonstrate both expertise in and extraordinary support and advocacy for IBM technology, communities, and solutions. I am an IBM Champion since the first class  (2011) an this year i wish to be  an IBM Champion for the year 2020. New Champion Nominations are open now through 22 November 2019. Current IBM Champions may submit a renewal through 9 November 2019. To nominate an IBM Champion use this link(https://developer.ibm.com/champions/)

Nominate an IBM ChampionRead More