Wednesday, 8 February 2017

Script to Change FND_USER password with default password after Cloning

** Default Password set to ChangeMe@123

[mxm510@acopprka001 autoclone]$ cat Change_password_DEVE.sh
function Change_fnd_user_password
{
cat /dev/null > password_failure.txt
sqlplus -s apps/appsdeve << EOF
set lines 300 pages 0 feedback off
spool fnd_user.lst
select 'FNDCPASS apps/appsdeve 0 Y system/systemdeve USER "'||USER_NAME||'" ChangeMe@123 || echo "Err while changing password for user - ' || user_name || '" >> password_failure.txt' from fnd_user where user_name not in ('APPSMGR','ASADMIN','INDUSTRY DATA','GUEST','SYSADMIN') and (user_name not like 'ORACLE%') and user_name not like 'APP%';
spool off;
EOF
#sed -e 1,+1d fnd_user.lst > fnd_user_2.lst
sh fnd_user.lst
if [ `wc -l password_failure.txt | awk '{print $1}'` -gt 0 ]
then
echo 'Following errors occured while changing Application User Passwords'
cat password_failure.txt
rm L*.log
else
echo "All the passwords of Application users got changed successfully to 'ChangeMe@123' "
rm L*.log
rm password_failure.txt
fi
}

Change_fnd_user_password

1 comment: