All,
 
I'm trying to determine what is wrong with this script.   Here is what
I'm trying to do:
 
1.)  Export the output of the following command to a file located at
c:\perl\bin\log\accessreport.log
       Global "Domain Admins" ARFW > c:\perl\bin\accessreport.log
 
2.)  For each line of information that is returned, execute the
following command (Ex. 1st line of output is jlw5038)
      Cscript "c:\program files\resource kit\useraccount.vbs"  /N
jlw5038 |grep FullName
 
3.)  I want the information that is grepped to be thrown into a separate
file called accessreport2.log
 
For whatever reason, I never make it to my first print statement within
the foreach code shown below.  This is a perl script created in a
Windows Environment for a windows environment and I'm running ActivePerl
5.8 on my system.
 
Any help is appreciated!
 
 
 
 
 
BEGIN:
 
# Exporting Windows 2000 Resource Kit command output to file
system("global \"Domain Admins\" ARFW >
c:\\perl\\bin\\log\\accessreport.log");
 
# Creating a foreach statement for each line of accessreport.log which
in this case is a userid.
open(IDS, "type c:\\perl\\bin\\log\\accessreport.log |");
@IDLIST=<IDS>;
foreach $USERID (@IDLIST)
                {
                                if ($USERID != "")
                                                {
 
chomp($USERID);
 
print("Processing UserID: $USERID\n");
 
open(FULLNAME, "cscript \"C:\\program files\\resource
kit\\useraccount.vbs\" /N $USERID |grep FullName |");
 
chomp($NAME=<FULLNAME>);
 
close(FULLNAME);
 
open(REPORT, ">c:\\perl\\bin\\logs\\accessreport2.log");
                                                                print
REPORT ("$USERID - $NAME\n");
 
close(REPORT);
                                                }
                }
 
EOF:
 
 


*******************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
*******************************************************

Reply via email to