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: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
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)perldoc -f open perldoc perlsyn # For the "foreach" loop perldoc Win32::NetAdmin perldoc -f print perldoc perlintro # May be of use
In reply to Re^3: Script to capture logged on users
by davis
in thread Script to capture logged on users
by devon22
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |