Hello Monks!

I have a general question, and this may or may not be the forum (I apologize if it is not).

I have a perl script on a windows server, and I would like to run this script on multiple windows servers.

If I simply copy the script to all the servers, and have perl installed on all the serves, then I know it will run fine. However, I would like to have the script run from only one server, and go out to all the servers and return the data. Below is the script.

#!/usr/local/bin/perl #use Win32; use Win32::DriveInfo; use strict; use warnings; print "OS Information\n"; my $computer=Win32::NodeName(); print "The computer name is $computer\n"; my %dtypes=(0 => "Undertmined", 1 => "Does Not Exist", 2 => "Removable", 3 => "Hardrive", 4 => "Network", 5 => "CDROM", 6 => "RAM Disk"); print "Drive Information\n"; my @drives = Win32::DriveInfo::DrivesInUse(); foreach my $drive (@drives){ my $type=Win32::DriveInfo::DriveType($drive); print "Drive $drive is a $dtypes{$type}\n"; if (($drive eq 'C') | ($drive eq 'H')) { my ($sectors, $bytessec, $freeclust, $clustnum, $userfree, $total, $to +talfree)=Win32::DriveInfo::DriveSpace($drive); #divide bytes to get gigabytes; my $gbtotal = sprintf("%.2f", ($total/1073741824)); my $gbfree = sprintf("%.2f", ($totalfree/1073741824)); my $gbused = sprintf("%.1f", ($gbtotal - $gbfree)); my $free = $gbfree/$gbtotal; my $perfree = sprintf("%.2f", ($free * 100)); #Print output printf "$gbfree GB free from total of $gbtotal GB\n"; printf "total GB used $gbused\n"; printf "$perfree%% free on drive $drive\n"; printf "\n"; } else {} } exit;

What if any options are available for me to run this perl script on multiple windows servers succesfully? Thak you for your time and contributions


In reply to Running Perl on Remote Windows Server by coding_new

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.