Thanks both for the info.
If you don't mind a follow up questions... where would I place the "chomp
@computer" in the script. I is currently not in the below script and when I
run it, it appears to run properly without any errors and creates the output
file, but no data is collected.
Thanks again and forgive my ignorance.
Mark
-----Original Message-----
From: Timothy Johnson [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 17, 2001 12:33 PM
To: 'Martin, James S.'; '[EMAIL PROTECTED]'
Subject: RE: srvinfo.exe collection
Not to be picky, but I think that for this to work you might want to do a
'chomp @computers' to get rid of the \n in the string.
-----Original Message-----
From: Martin, James S. [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 17, 2001 8:12 AM
To: '[EMAIL PROTECTED]'
Subject: RE: srvinfo.exe collection
I'm feeling awefully generous today, so let me help you. First you'll want
to have a flat file of the computers you wish to collect the info on...
contents of the file would look like:
computer1
computer2
computer3
computer4
call that file, "computers.txt".
then you're perl program would do something like this:
###############################################################
open COMPUTERS,("computers.txt"); #open your computer list file
open OUTPUT, (">>output.txt"); #open your output file
@computers=<COMPUTERS>; #put the list of computers into an array
close COMPUTERS; #close the list file
foreach $computer(@computers) { #begin looping through the computers
print "Now working on $computer"; #print status message
$info=`srvinfo \\\\$computer`; #run srvinfo command and set
result to $info variable
print OUTPUT $info; #print result to your output file
print OUTPUT "###############################\n"; #print a
seperator
}
close OUTPUT; #close your output file
That should work no problem.
James
-----Original Message-----
From: Clayman, Mark [mailto:[EMAIL PROTECTED]]
Sent: Sunday, September 16, 2001 11:18 PM
To: '[EMAIL PROTECTED]'
Subject: srvinfo.exe collection
Hi All,
Forgive me as I'm a novice to Perl scripting, but I was wondering if someone
would be able to point me in the right direction. I'd like to create a
script to run srvinfo.exe against a list of servers and/or ip address and
collect the info in one file to report on later.
Any help would be appreciated.
Thanks
Mark
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin