Getting a list of MDS admin names

I know there is probably a command for this but I wanted to do some awk’ing. I know fwm dbexport will work on smartcenters.

This awk script will export and print the login names of MDS/P1 administrators

cd $MDSDIR/conf/mdsdb/

cat cp-admins.C | awk ‘{ x[NR] = $0} END {for(i=1;i<=NR;i++) {if (x[i] ~ /AdminInfo/ && x[i-1] ~ /[[:alnum:]]/ && x[i-1] !~ /sic/) {$d=x[i-1];gsub(/[^[:alnum:]]/,””,$d);print $d}    }}’ | more

As a side note:

$MDSDIR/conf  — Holds the data from the global policy database
$MDSDIR/conf/mdsdb – Holds the data that supports the MDM environment.



Addition: For printing out names that are in the comments

header_id (1) is the name field and (2), (3), etc are the contact, URL, etc

cat $MDSDIR/conf/mdsdb/cp-admins.C | awk ‘{ x[NR] = $0} END {for(i=1;i<=NR;i++) {if (x[i] ~ /header_id \(1\)/) print x[i+1];}}’ | awk -F\” ‘{print  $2  }’



Post a comment or leave a trackback: Trackback URL.


  • d  On January 3, 2013 at 5:57 am

    or you could just mdsquerydb Administrators

    • dreezman  On January 12, 2013 at 2:44 pm

      Yes, good point.

      I was also looking for the domains the admin was associated with. Not sure how to get that from mdsquerydb.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Helen's Loom

"Peculiar travel suggestions are dancing lessons from God." - Kurt Vonnegut

Life Stories from Dreez

These are stories from my travels. Generally I like to write stories about local people that I meet and also brag about living the retirement dream with my #1 wife Gaby. She is also my only wife.

%d bloggers like this: