If you're new to programming, I suggest writing your algorithm out in psuedocode first. Your requirements might look like this:
open INFILE for reading open RESULTS for writing foreach machine_name (in INFILE) { # loop over lines in input file results = LoggedOnUsers(machine_name) print results to RESULTS } close INFILE close RESULTS
That's the basis of your algorithm (without any error-checking — you'd want to add this). I'd look at the following for the syntax:
perldoc -f open perldoc perlsyn # For the "foreach" loop perldoc Win32::NetAdmin perldoc -f print perldoc perlintro # May be of use
I'm pretty sure that it doesn't matter which machine you run this from. I'm also pretty sure that you'd have to run this as a Domain Admin (to have rights to the LoggedOnUsers function)
Welcome to the world of scholastic monastics, btw.

davis
Kids, you tried your hardest, and you failed miserably. The lesson is: Never try.

In reply to Re^3: Script to capture logged on users by davis
in thread Script to capture logged on users by devon22

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.