Password expire time script "tru64"

From: Binkley Robert - rbinkl (Robert.Binkley_at_acxiom.com)
Date: 05/27/03

  • Next message: NotariE_at_usa.redcross.org: "SUMMARY2: Looking for a SEYON like emulator for Tru64"
    Date: Tue, 27 May 2003 10:30:45 -0500
    To: "Tru64 UNIX Admins (E-mail) (E-mail)" <tru64-unix-managers@ornl.gov>, "Tru64-Unix-Managers (E-mail)" <tru64-unix-managers@ornl.gov>
    
    

    #!/usr/bin/perl
      $host=`hostname`; chomp($host);
          $cnt=0;
          $from="root\@$host.com";
          $sendmailpath="/usr/sbin/sendmail";
          $pwfile="/etc/passwd";
           open (PASS,"<$pwfile") or die "File doesn't Exist";
           while (<PASS>)
                 {
                  @userline = split (":",$_);
                  chomp(@userline);
                  $user = $userline[0]; chomp($user);
          open(GETAUTH,"/usr/tcb/bin/edauth -g $user|") || die "Error $!";
          my $myString="";
          while(<GETAUTH>)
               {
                $myString .= $_;
               }
            close(GETAUTH);
           ($_ = $myString) =~ tr/:\\\n\t/:/sd;
           if(/u_succhg#\d*/)
              {
              $_ =~ m/u_succhg#(\d*)/;
              $last_change=$1;
              chomp($last_change);
                $def_exp = 7776000; # 90 Days
                $myexpiry = $last_change+$def_exp;
                $info_date = $myexpiry-172800;
                $exp_date=scalar localtime($myexpiry);
                $today=time; $reportdate=scalar localtime($today);
                $dtexp=$myexpiry-$today; #In Seconds
                print "$user => dtexp => $dtexp , myexpiry => $myexpiry\n";
                if ($myexpiry != 7776000 and $dtexp < 172800)
                   {
                 $cnt++;
                 if ($dtexp < 0)
                   {
                    $myverb = "Expires On";
                   }
                 else
                   {
                   $myverb = "Will Expire On ";
                   }
                 $exp_list .= "==>> $user\'s Password $myverb on $exp_date\n";
                   }
               }
    }
             if ($cnt > 0)
                {
                # $to="root\@domain.com,root\@domain.com"; # Need to edit this
    line
                 $subject=uc($host)." Password Expiry Report of $reportdate";
                 open (SENDMAIL, "| $sendmailpath -t");
                 print SENDMAIL "Subject: $subject\n";
                 print SENDMAIL "From: $from\n";
                 print SENDMAIL "To: $to\n\n";
                 print SENDMAIL "Password Expiration List, Check & Take
    action\n\n";
                 print SENDMAIL "$exp_list\n\n";
                 print SENDMAIL "Bye!\n\n";
                 print SENDMAIL "root";
                 close (SENDMAIL);
                 }

    #####################################output#################################
    ###

    root => dtexp => 7078199 , myexpiry => 1061127491
    wnn => dtexp => 7078193 , myexpiry => 1061127486
    pop => dtexp => 7078193 , myexpiry => 1061127486
    imap => dtexp => 7078193 , myexpiry => 1061127486
    opensys => dtexp => 7078193 , myexpiry => 1061127486
    oracle => dtexp => 7078193 , myexpiry => 1061127486
    iass => dtexp => 7078193 , myexpiry => 1061127486
    httpd => dtexp => 7078193 , myexpiry => 1061127486
    jlemle => dtexp => 7078193 , myexpiry => 1061127486
    cvs => dtexp => 7078192 , myexpiry => 1061127486

    **********************************************************************
    The information contained in this communication is
    confidential, is intended only for the use of the recipient
    named above, and may be legally privileged.
    If the reader of this message is not the intended
    recipient, you are hereby notified that any dissemination,
    distribution, or copying of this communication is strictly
    prohibited.
    If you have received this communication in error,
    please re-send this communication to the sender and
    delete the original message or any copy of it from your
    computer system. Thank You.


  • Next message: NotariE_at_usa.redcross.org: "SUMMARY2: Looking for a SEYON like emulator for Tru64"

    Relevant Pages

    • [HPADM] RE: Security Tracking
      ... I have been given a task, on monitoring one of out credit customers ... The information contained in this communication is ... is intended only for the use of the recipient ... delete the original message or any copy of it from your ...
      (HP-UX-Admin)
    • [HPADM] Summary Hparray problem
      ... The information contained in this communication is ... is intended only for the use of the recipient ... distribution, or copying of this communication is strictly ...
      (HP-UX-Admin)
    • Resize root volume with Solaris Volume Manager
      ... I was able to successfully resize ... The information contained in this communication is ... is intended only for the use of the recipient ... delete the original message or any copy of it from your ...
      (SunManagers)
    • COM Help
      ... some searching and reading on google I have run ... The information contained in this communication is ... is intended only for the use of the recipient ... delete the original message or any copy of it from your ...
      (comp.lang.python)
    • Re: Help renaming devices
      ... of my TSM server for library sharing, i.e rmt1 on the client is rmt4 on the ... The information contained in this communication is ... is intended only for the use of the recipient ... delete the original message or any copy of it from your ...
      (AIX-L)