1 Reply Latest reply on Nov 8, 2017 9:44 AM by John_K

    Enable User using fnd_user_pkg.ENABLEUSER need help

    1567114

      Hello,

       

      I have written a script first to disable all the users and then enable it .

       

      --Disable the users except SYSADMIN

       

      declare cursor cur_disable is

      select user_name from apps.fnd_user where UPPER(user_name) Not IN ('SYSADMIN');

      begin

      for all_user_disb in cur_disable loop

      apps.fnd_user_pkg.DISABLEUSER(all_user_disb.user_name);

      commit;

      end loop;

      End;

      /

       

       

      --Enable the users except SYSADMIN

       

      I need to Enable the Users and give them a default password so that once enabled it I need not to go to each and every using using SYSADMIN and change the password.

       

      I need to Enable the users and set a default password after enable to 'welcome123'

       

       

      declare cursor cur_enable is

      select user_name from apps.fnd_user where UPPER(user_name) Not IN ('SYSADMIN');

      begin

      for all_user_enab in cur_enable loop

      apps.fnd_user_pkg.ENABLEUSER(all_user_enab.user_name);

      commit;

      end loop;

      End;

      /

        • 1. Re: Enable User using fnd_user_pkg.ENABLEUSER need help
          John_K

          1) It's generally bad practice to commit inside a loop (can lead to various problems, some obvious, some not so).

          2) You can use fnd_user_pkg.changepassword. i.e.

          Begin
            If Not fnd_user_pkg.changepassword ('MYUSERNAME', 'MyPaS5w0rd!')
            Then
              raise_application_error(-20000,'Couldn''t change the password');
            End If;
            Commit;
          End;
          
          1 person found this helpful