Happy New Year 2022 😀 Thank you for visiting the site !!! Click on the below interested Ads to support us if you like the site .Sharing is caring .keep distance and keep safe . Happy Learning ... 😀

List user’s and its roles from Weblogic using wlst script

List Weblogic Admin console user’s using script

We can login in to Weblogic Admin console to see the List of ID’s and roles .
In this page we will see how to list the user’s and role from the script.

cat listUser.wlst
cmo.exportData('DefaultAtn','/tmp/export.ldif', Properties())

Replace the HOSTNAME With correct Hostname or IP Address ,userid and passwrod .Above wlst will export the data into /tmp/export.ldif
/tmp/export.ldif is txt readable file . Part it using shell script to print the username and roles.

cat listUser.sh
echo "Printing User ID <--> Groups "
while read line ; do
if [ -z "$line" ]; then
ID=`cat /tmp/id.txt| grep -i "dn: uid="`
if [ ! -z "$ID" ] ; then
echo "`cat /tmp/id.txt| grep -i \"dn: uid=\" |awk -F"," '{ print $1 }'` <--> `cat /tmp/id.txt | grep \"wlsMemberOf:\" | awk -F"," '{ print $1 }'`"
echo $line >> /tmp/id.txt

Now you can run one by one script .

chmod 755 listUser.wlst listUser.sh

The above 2 will get the list of UserID and it’s roles created in Weblogic Domain .

Related Posts

Leave a Reply

Your email address will not be published.