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  }’

 

 

Advertisements
Post a comment or leave a trackback: Trackback URL.

Comments

  • 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.

      dreez

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

blog.lachmann.org

Michael Endrizzi's - St. Paul MN - CheckPoint blog on topics related to Check Point products and security in general.

%d bloggers like this: