2 Replies Latest reply on Apr 29, 2011 1:35 AM by SDESK

    Automate un soft deletion of a re hired user

    Apprentice

      We import and update our Users via the service desk scheduled data import.  Using a script supplied on the community, we automate the soft deletion of accounts that have been set to a status of 'Inactive':  http://community.landesk.com/support/docs/DOC-2535

       

      We would like to also unsoft delete these accounts automatically where a User has been re hired and seem to be able to do this successfully on our test system:

       

      UPDATE tps_user SET tps_deleted = '0' WHERE usr_UserStatus = 'Active'

       

      Before implementing this on our production system, would like to know if there are any implications of not using the supplied undelete script (below)  that is available on the community.  It would seem that this script cannot be automated as it is not intelligent enough to find the specific Users that have been soft deleted and must be supplied with a network login.

       

      Any feedback or implications of using the above script welcome

       

      update tps_user set tps_deleted = '0', usr_deletedinad=null where tps_name = 'testuser'
      update tps_password set tps_deleted = '0' where tps_guid = (select tps_password_id from tps_user where tps_name = 'testuser')