Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
use strict; use Win32::NetAdmin; use Net::SMTP; my $dc = "\\\\x"; my $from = 'x@x.com'; my @recip_list = ('x@x.com', 'y@y.com'); my $smtp_host = "x.x.x.x"; my @users = (); my $VERSION = "1.2"; my $smtp = Net::SMTP->new($smtp_host, Timeout => 30) || die "Can't con +nect to $smtp_host.\n"; $smtp->mail($from) || die "cannot mail from.\n\n"; $smtp->recipient(@recip_list); $smtp->data(); $smtp->datasend("To:\tPerl Recipients\n"); $smtp->datasend("Subject:\tPerl output of Users in the domain\n\n"); Win32::NetAdmin::GetUsers($dc, undef, \@users) || die "GetUsers failed +.\n"; foreach (@users) { $smtp->datasend( "$_\n\n"); } $smtp->dataend; $smtp->quit; =head1 NAME adminmail - This script grabs a list of all the users in a domain and +emails the results to an email address. =head1 DESCRIPTION This program is useful for quickly getting a list of all the users on +your domain. I wrote this program when our Notes administrator "Maddog" needed a list of users on the domain. =head1 README This script grabs a list of all the users in a domain and emails the r +esults to an email address. =head1 PREREQUISITES This script has a few requirements. You will need the Win32::NetAdmin + and Net::SMTP modules. You will also need to change the values for dc, from, recip_list, and +smtp_host. =head1 COREQUISITES None =pod OSNAMES MSWin32 =pod SCRIPT CATEGORIES Win32/Utilities =cut

In reply to Adminmail.pl by ergowolf

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others making s'mores by the fire in the courtyard of the Monastery: (7)
    As of 2014-09-15 03:52 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite cookbook is:










      Results (145 votes), past polls