• Please help support our sponsors by considering their products and services.
    Our sponsors enable us to serve you with this high-speed Internet connection and fast webservers you are currently using at ADSM.ORG.
    They support this free flow of information and knowledge exchange service at no cost to you.

    Please welcome our latest sponsor Tectrade . We can show our appreciation by learning more about Tectrade Solutions
  • Community Tip: Please Give Thanks to Those Sharing Their Knowledge.

    If you receive helpful answer on this forum, please show thanks to the poster by clicking "LIKE" link for the answer that you found helpful.

  • Community Tip: Forum Rules (PLEASE CLICK HERE TO READ BEFORE POSTING)

    Click the link above to access ADSM.ORG Acceptable Use Policy and forum rules which should be observed when using this website. Violators may be banned from this website. This notice will disappear after you have made at least 3 posts.

[HOWTO] Nice TSM Admin Query

DanGiles

ADSM.ORG Senior Member
#1
It took me hours to come up with this, so I wanted to post and share. I had to come up with this for audit. The output comes out like this:

Code:
Name                     Last Access       P/W Reset       P/W Expire     Locked      SYSTEM      POLICY      OPERATOR
-------------------     ------------     -----------     ------------     -------     -------     -------     ---------
XXXXX                     2017-04-27      2017-04-03               62     NO          Yes         Yes         Yes
XXXXXX                    2017-05-16      2017-04-19               62     NO          Yes         Yes         Yes
IBM-OC-TSMTRV1            2017-05-16      2014-12-22                0     NO          Yes         Yes         Yes
XXXXXXX                   2017-05-15      2017-04-04               62     NO          Yes         Yes         Yes
SERVER_CONSOLE                                                            NO          Yes         Yes         Yes
VMPROXYADMIN              2017-05-02      2016-08-03                0     NO          Yes         Yes         Yes
XXXXXXX                   2017-05-02      2017-03-29               62     NO                      Yes
XXXXXXXX                  2016-10-31      2016-10-31               62     NO                      Yes
XXXXXXX                   2017-05-16      2017-04-18               62     NO                      Yes
REPORTER                  2017-05-16      2015-06-04                0     NO                                  Yes
Here's the select statement. If you put it in a script, it runs fine (but don't forget to double the quotes!). If you try to run as-is, it's too long and you'll need to break it up with continuation marks. Let me know what you think.

Code:
select cast(coalesce(c.admin,d.admin_name) as char(18)) as "Name",coalesce(c.acc,d.lastacc) as "Last Access", coalesce(c.pw,d.pwset) as "P/W Reset",coalesce(c.exp,d.passexp) as "P/W Expire",coalesce(c.lock,d.locked) as "Locked",system,policy,operator from (select coalesce(a.admin_name,b.admin_name) as admin,coalesce(a.lastacc,b.lastacc) as acc, coalesce(a.pwset,b.pwset) as pw,coalesce(a.passexp,b.passexp) as exp,coalesce(a.locked,b.locked) as lock,policy,operator from (select admin_name,date(lastacc_time) as lastacc,date(pwset_time) as pwset,passexp,locked,'Yes' as Policy from admins where policy_priv<>'No') as a full outer join (select admin_name,date(lastacc_time) as lastacc,date(pwset_time) as pwset,passexp,locked,'Yes' as operator from admins where operator_priv<>'No') as b on a.admin_name=b.admin_name ) as c full outer join (select admin_name,date(lastacc_time) as lastacc,date(pwset_time) as pwset,passexp,locked,'Yes' as system from admins where system_priv<>'No') as d on c.admin=d.admin_name
 

Advertise at ADSM.ORG

If you are reading this, so are your potential customer. Advertise at ADSM.ORG right now.

UpCloud high performance VPS at $5/month

Get started with $25 in credits on Cloud Servers. You must use link below to receive the credit. Use the promo to get upto 5 month of FREE Linux VPS.

The Spectrum Protect TLA (Three-Letter Acronym): ISP or something else?

  • Every product needs a TLA, Let's call it ISP (IBM Spectrum Protect).

    Votes: 8 23.5%
  • Keep using TSM for Spectrum Protect.

    Votes: 17 50.0%
  • Let's be formal and just say Spectrum Protect

    Votes: 5 14.7%
  • Other (please comement)

    Votes: 4 11.8%

Forum statistics

Threads
30,926
Messages
131,573
Members
21,207
Latest member
Nur03