OK, so I have this script that I created and thought it was working fine. It starts with 1 input file and ultimately creates output files that are used as inputs later and then in the end creates a final output file that is supposed to tell em what PC's have a certain hotfix using another input on that one.
what we have so far:
TWSSRVINFO.PL (The script consists of 3 parts. running srvinfo.exe to find specs on a system over a network (syntax is srvinfo -ns [system]. The -ns is for no services. Taking those specs and finding only the server name and what hotfixes it has. Taking the last information and comparing to another user created file to see which systems DO NOT have a specified hotfix.)
TWSPCINFO.txt (User created first input used.)
TWSSRVINFO.txt (first output created, this is then used as input on the second part.)
TWSHOTFIXES.txt (second output created, which is then used as one of the inputs for the 3rd and last part of the script.)
HOTLIST.txt (User created input that has what hotfixes you are looking for.)
TWSNEED.txt (Final output that shows what TWS DO NOT have the certain hotfixes, so you know which ones still need it.)
Here is what I thought to be my final perl product (hope this all fits):
#!/usr/local/bin/perl
#Team Workstation srvinfo Section
print "Backing up old twssrvinfo.txt... \n";
rename ("C\:\\perl_scripts\\srvinfopc\\txtfiles\\TWS\\twssrvinfo.txt", "C\:\\perl_scripts\\srvinfopc\\txtfiles\\TWS\\bac\\twssrvinfo.bac" || die "Cannot rename twssrvinfo.txt: $!";
print "Starting Server hotfixes finder \n";
open (TWSPCINFO, "C\:\\perl_scripts\\srvinfopc\\txtfiles\\TWS\\twspcinfo.txt" or die "I could not get at twspcinfo.txt as input";
open (TWSSRVINFO, ">>C\:\\perl_scripts\\srvinfopc\\txtfiles\\TWS\\twssrvinfo.txt" or die "I could not open twssrvinfo.txt as output";
my $time;
$time = localtime(time());
print TWSSRVINFO "$time.---------------------------------------------------------------\n\n";
while (<TWSPCINFO>)
{
chomp;
my $srv;
$srv=$_;
print "$srv \n";
my $result;
$result = `srvinfo -ns \\\\$srv`;
print TWSSRVINFO "Server Name: $srv\n";
print TWSSRVINFO "$result\n";
print TWSSRVINFO "\n===========================\n\n";
}
close TWSPCINFO;
close TWSSRVINFO;
#Team Workstation hotfixes Section
print "Backing up old twshotfixes.txt... \n";
rename ("C\:\\perl_scripts\\srvinfopc\\txtfiles\\TWS\\twshotfixes.txt", "C\:\\perl_scripts\\srvinfopc\\txtfiles\\TWS\\bac\\twshotfixes.bac" || die "Cannot rename twshotfixes.txt: $!";
open (TWSINPUT, "C\:\\perl_scripts\\srvinfopc\\txtfiles\\TWS\\twssrvinfo.txt" or die "I could not open twssrvinfo.txt";
($WAIT_NAME, $WAIT_FIX, $WAIT_DRIVE) = (0,1,2);
open (TWSOUTPUT, ">>C\:\\perl_scripts\\srvinfopc\\txtfiles\\TWS\\twshotfixes.txt" or die "I could not open twshotfixed.txt";
$CUR_STATE = $WAIT_NAME;
@FIXES;
while(<TWSINPUT>)
{
if($CUR_STATE == $WAIT_NAME && /^Server\ Name\:\ (.+)\n/)
{
print TWSOUTPUT "\n";
print TWSOUTPUT "$1";
chomp;
$CUR_STATE = $WAIT_FIX;
}
#if(/^Server\ Name\:\ (.+)\n/)
#{
# print TWSOUTPUT "$1";
# $CUR_STATE = $WAIT_FIX;
#}
elsif($CUR_STATE == $WAIT_FIX && /^Network\ Error\ (.+)\n/)
{
print TWSOUTPUT " $1\n";
chomp;
$CUR_STATE = $WAIT_NAME;
}
elsif($CUR_STATE == $WAIT_FIX && /^Hotfixes/)
{
$CUR_STATE = $WAIT_DRIVE;
}
elsif($CUR_STATE == $WAIT_DRIVE && /^Drive/)
{
$CUR_STATE = $WAIT_NAME;
print TWSOUTPUT "@FIXES\n";
chomp;
}
elsif($CUR_STATE == $WAIT_DRIVE && /^Network/)
{
$CUR_STATE = $WAIT_NAME;
print TWSOUTPUT "@FIXES\n";
chomp;
}
elsif($CUR_STATE == $WAIT_DRIVE && /^Protocols/)
{
$CUR_STATE = $WAIT_NAME;
print TWSOUTPUT "@FIXES\n";
chomp;
}
elsif($CUR_STATE == $WAIT_DRIVE && /\[(.+)\]\:/)
{
push (@FIXES, ",$1"
}
else
{
# die "INVALID DATA:$_";
}
}
close TWSINPUT;
close TWSOUTPUT;
#Team Workstation needed hotfixes Section
print "Backing up old twsneed.txt... \n";
rename ("twsneed.txt", "C\:\\perl_scripts\\srvinfopc\\txtfiles\\TWS\\bac\\twsneed.bac" || die "Cannot rename twsneed.txt: $!";
print "looking for Team Workstations without listed hotfixes. Please be patient.\n";
open (HOTLIST, "hotlist.txt" or die "I could not open hotlist as input";
open (TWSNEEDLIST, ">>twsneed.txt" or die "I cannot open twsneed.txt as output";
my $time;
$time = localtime(time());
print TWSNEEDLIST "$time.---------------------------------------------------------------\n\n";
while(<HOTLIST>)
{
chomp;
my $fix;
$fix=$_;
print "$fix \n";
print TWSNEEDLIST "hotfix: $fix \n\n";
my $hots;
$hots = `findstr -v $fix C\:\\perl_scripts\\srvinfopc\\txtfiles\\TWS\\twshotfixes.txt`;
print TWSNEEDLIST "$hots\n\n";
print TWSNEEDLIST "==============================================================================\n\n";
}
close HOTLIST;
close TWSNEEDLIST;
Now that you see that I will show you what my other inputs look like.
TWSPCINFO.txt:
rrc7850-desk
rrc7299-desk
rrc7793-desk
TWSSRVIFO.txt:
Thu Jan 1 11:03:15 2004.---------------------------------------------------------------
Server Name: rrc7850-desk
Server Name: rrc7850-desk
Security: Users
Registered Owner: (omited)
Registered Organization: (Omited)
ProductID: (Omited)
Original Install Date: Sat Nov 29 11:09:41 2003
Base Source Path: C:\drivers\i386
Service Pack Source Path: D:Version: 5.1
Build: (omited)
Current Type: Uniprocessor Free
Product Name: Microsoft Windows XP
Product Options: Professional
HAL.DLL is (omited)
PDC: (omited)
Domain: (omited)
Domain Guid: (omited)
DNS Forest Name: (omited)
PDC Site Name: (omited)
Computer Site Name: (omited)
CPU[0]: x86 Family 6 Model 8 Stepping 6: 930 MHz
System BIOS Date: 09/21/00
System BIOS Version: IBM - 1010, IBM BIOS Ver PIKT24.0
Hotfixes:
Windows XP:
SP2
[KB823559]: Installed on 11/29/2003 by Administrator
[KB824146] Installed on 11/29/2003 by Administrator
[Q323255]: Installed on 4/7/2003 by Administrator
[Q328310]: Installed on 4/7/2003 by Administrator
[Q329390]: Installed on 4/7/2003 by Administrator
[Q331953]: Installed on 11/29/2003 by Administrator
[Q810097]: Installed on 4/7/2003 by Administrator
[Q810833]: Installed on 11/29/2003 by Administrator
[Q815021]: Installed on 11/29/2003 by Administrator
[Q816556]: Installed on 11/29/2003 by Administrator
[Q817606]: Installed on 11/29/2003 by Administrator
Windows Media Player:
wm817787
[FileList]: Installed on ??/??/?? by Unknown
Drive: [FileSys] [ Size ] [ Free ] [ Used ]
C$ NTFS 19470 14310 5160
Network Card [0]: IBM 10/100 EtherJet PCI Management Adapter
IP Address(es): (omited)
MAC Address: (omited)
Protocols:
Layer 2 Tunneling Protocol
Remote Access NDIS WAN Driver
Point to Point Tunneling Protocol
WINS Client(TCP/IP) Protocol
Internet Protocol (TCP/IP)
Point to Point Protocol Over Ethernet
NDIS Usermode I/O Protocol
Message-oriented TCP/IP Protocol (SMB session)
System Up Time: 0 Days, 6 Hr, 54 Min, 51 Sec
===========================
Server Name: rrc7299-desk
Server Name: rrc7299-desk
Security: Users
Registered Owner: (omited)
Registered Organization: (omited)
ProductID: (omited)
Original Install Date: Fri Jun 27 11:09:30 2003
Base Source Path: (omited)
Service Pack Source Path: c:\push
Version: 5.0
Build: 2195, Service Pack 4
Current Type: Uniprocessor Free
Product Name: Microsoft Windows 2000
Product Options: Professional
HAL.DLL is (omited)
PDC: (omited)
Domain: (omited)
Domain Guid: (omited)
DNS Forest Name: (omited)
PDC Site Name: (omited)
Computer Site Name: (omited)
CPU[0]: x86 Family 6 Model 8 Stepping 6: 930 MHz
System BIOS Date: 09/21/00
System BIOS Version: IBM BIOS Ver PIKT24.0
Hotfixes:
Windows Media Player:
wm320920.1
[FileList]: Installed on ??/??/?? by Unknown
Windows 2000:
SP4
[Q327194]: Installed on 12/27/2003 by SYSTEM
SP5
[KB823559]: Installed on 12/27/2003 by SYSTEM
[KB823980]: Installed on 8/7/2003 by jmdykstr
[KB824146]: Installed on 9/20/2003 by jmdykstr
[KB828035]: Installed on 12/1/2003 by SYSTEM
[KB828749]: Installed on 12/3/2003 by SYSTEM
DataAccess:
Q323264
Q329414-25
Drive: [FileSys] [ Size ] [ Free ] [ Used ]
C$ NTFS 8229 3735 4494
Network Card [0]: IBM 10/100 EtherJet PCI Management Adapter
IP Address(es): (omited)
MAC Address: (omited)
Protocols:
Message-oriented TCP/IP Protocol (SMB session)
Remote Access NDIS WAN Driver
Point to Point Tunneling Protocol
Layer 2 Tunneling Protocol
WINS Client(TCP/IP) Protocol
Internet Protocol (TCP/IP)
NDIS Usermode I/O Protocol
System Up Time: 2 Days, 5 Hr, 8 Min, 46 Sec
===========================
Server Name: rrc7793-desk
Server Name: rrc7793-desk
Security: Users
Registered Owner: (omited)
Registered Organization: (omited)
ProductID: (omited)
Original Install Date: Fri Jun 27 11:09:30 2003
Base Source Path: (omited)
Service Pack Source Path: D:Version: 5.0
Build: 2195, Service Pack 3
Current Type: Uniprocessor Free
Product Name: Microsoft Windows 2000
Product Options: Professional
HAL.DLL is (omited)
PDC: (omited)
Domain: (omited)
Domain Guid: (omited)
DNS Forest Name: (omited)
PDC Site Name: (omited)
Computer Site Name: (omited)
CPU[0]: x86 Family 6 Model 8 Stepping 6: 930 MHz
System BIOS Date: 09/21/00
System BIOS Version: IBM BIOS Ver PIKT24.0
Hotfixes:
Windows Media Player:
wm320920.1
[FileList]: Installed on ??/??/?? by Unknown
Windows 2000:
SP4
[Q323255]: Installed on 6/27/2003 by Administrator
[Q326830]: Installed on 6/27/2003 by Administrator
[Q328310] Installed on 6/27/2003 by Administrator
[Q331953]: Installed on 6/27/2003 by Administrator
[Q810030]: Installed on 6/27/2003 by Administrator
[Q810833]: Installed on 6/27/2003 by Administrator
[Q815021]: Installed on 8/21/2003 by
SP5
[KB823980]: Installed on 8/7/2003 by
[KB824146]: Installed on 9/20/2003 by
[KB828035]: Installed on 11/26/2003 by SYSTEM
[KB828749]: Installed on 12/3/2003 by SYSTEM
DataAccess:
Q323264
Q329414-25
Drive: [FileSys] [ Size ] [ Free ] [ Used ]
C$ NTFS 11006 6149 4857
G$ FAT32 4111 2307 1804
Network Card [0]: IBM 10/100 EtherJet PCI Management Adapter
IP Address(es): (omited)
MAC Address: (omited)
Protocols:
Message-oriented TCP/IP Protocol (SMB session)
Remote Access NDIS WAN Driver
Point to Point Tunneling Protocol
Layer 2 Tunneling Protocol
WINS Client(TCP/IP) Protocol
Internet Protocol (TCP/IP)
System Up Time: 0 Days, 9 Hr, 44 Min, 25 Sec
===========================
TWSHOTFIXES.txt
rrc7850-desk,KB823559 ,KB824146 ,Q323255 ,Q328310 ,Q329390 ,Q331953 ,Q810097 ,Q810833 ,Q815021 ,Q816556 ,Q817606 ,FileList
rrc7299-desk,KB823559 ,KB824146 ,Q323255 ,Q328310 ,Q329390 ,Q331953 ,Q810097 ,Q810833 ,Q815021 ,Q816556 ,Q817606 ,FileList ,FileList ,Q327194 ,KB823559 ,KB823980 ,KB824146 ,KB828035 ,KB828749
rrc7793-desk,KB823559 ,KB824146 ,Q323255 ,Q328310 ,Q329390 ,Q331953 ,Q810097 ,Q810833 ,Q815021 ,Q816556 ,Q817606 ,FileList ,FileList ,Q327194 ,KB823559 ,KB823980 ,KB824146 ,KB828035 ,KB828749 ,FileList ,Q323255 ,Q326830 ,Q328310 ,Q331953 ,Q810030 ,Q810833 ,Q815021 ,KB823980 ,KB824146 ,KB828035 ,KB828749
HOTLIST.txt:
828035
828749
815021
TWSNEED.txt
Thu Jan 1 11:16:18 2004.---------------------------------------------------------------
hotfix: 828035
rrc7850-desk,KB823559 ,KB824146 ,Q323255 ,Q328310 ,Q329390 ,Q331953 ,Q810097 ,Q810833 ,Q815021 ,Q816556 ,Q817606 ,FileList
==============================================================================
hotfix: 828749
rrc7850-desk,KB823559 ,KB824146 ,Q323255 ,Q328310 ,Q329390 ,Q331953 ,Q810097 ,Q810833 ,Q815021 ,Q816556 ,Q817606 ,FileList
==============================================================================
hotfix: 815021
==============================================================================
Of course anythign that could possibly be confidential to Intel has been omited. I also added in bold red the information I want to grab from the TWSSRVINFO.txt file.
OK, now you have all the text files that are created and what i see when it is finalized inall areas.
The problem I am having is that TWSHOTFIXES seems to be duplcating and not chomping something off. This means when the last one runs, it will not show me a system that needs the hotfixes because the files say it does, and that is only because it is retaining the information from the start.
I have tried adding a chomp to the beginning of the while loop and that does not work at all, I just get a sheet with the hotfixes name on it in the end.
Anyone out there that can take a look at thisand tell me what I am doing wrong? I am so lost now, it took me forever to get this far and now I feel dumb cause i cant figure this out.
(FYI: the script is written like it is because I am new, I did not try to condense it to make it shorter, I just wanted to see what each part looks like when it is done and then maybe in about a hundred years when I am proficient in perl I will condense it down if it is possible)
I want to thank you gusy in advance if you can help me. (If this script works, I save hours of time manually going System by system to see if someone has installed a patch)
what we have so far:
TWSSRVINFO.PL (The script consists of 3 parts. running srvinfo.exe to find specs on a system over a network (syntax is srvinfo -ns [system]. The -ns is for no services. Taking those specs and finding only the server name and what hotfixes it has. Taking the last information and comparing to another user created file to see which systems DO NOT have a specified hotfix.)
TWSPCINFO.txt (User created first input used.)
TWSSRVINFO.txt (first output created, this is then used as input on the second part.)
TWSHOTFIXES.txt (second output created, which is then used as one of the inputs for the 3rd and last part of the script.)
HOTLIST.txt (User created input that has what hotfixes you are looking for.)
TWSNEED.txt (Final output that shows what TWS DO NOT have the certain hotfixes, so you know which ones still need it.)
Here is what I thought to be my final perl product (hope this all fits):
#!/usr/local/bin/perl
#Team Workstation srvinfo Section
print "Backing up old twssrvinfo.txt... \n";
rename ("C\:\\perl_scripts\\srvinfopc\\txtfiles\\TWS\\twssrvinfo.txt", "C\:\\perl_scripts\\srvinfopc\\txtfiles\\TWS\\bac\\twssrvinfo.bac" || die "Cannot rename twssrvinfo.txt: $!";
print "Starting Server hotfixes finder \n";
open (TWSPCINFO, "C\:\\perl_scripts\\srvinfopc\\txtfiles\\TWS\\twspcinfo.txt" or die "I could not get at twspcinfo.txt as input";
open (TWSSRVINFO, ">>C\:\\perl_scripts\\srvinfopc\\txtfiles\\TWS\\twssrvinfo.txt" or die "I could not open twssrvinfo.txt as output";
my $time;
$time = localtime(time());
print TWSSRVINFO "$time.---------------------------------------------------------------\n\n";
while (<TWSPCINFO>)
{
chomp;
my $srv;
$srv=$_;
print "$srv \n";
my $result;
$result = `srvinfo -ns \\\\$srv`;
print TWSSRVINFO "Server Name: $srv\n";
print TWSSRVINFO "$result\n";
print TWSSRVINFO "\n===========================\n\n";
}
close TWSPCINFO;
close TWSSRVINFO;
#Team Workstation hotfixes Section
print "Backing up old twshotfixes.txt... \n";
rename ("C\:\\perl_scripts\\srvinfopc\\txtfiles\\TWS\\twshotfixes.txt", "C\:\\perl_scripts\\srvinfopc\\txtfiles\\TWS\\bac\\twshotfixes.bac" || die "Cannot rename twshotfixes.txt: $!";
open (TWSINPUT, "C\:\\perl_scripts\\srvinfopc\\txtfiles\\TWS\\twssrvinfo.txt" or die "I could not open twssrvinfo.txt";
($WAIT_NAME, $WAIT_FIX, $WAIT_DRIVE) = (0,1,2);
open (TWSOUTPUT, ">>C\:\\perl_scripts\\srvinfopc\\txtfiles\\TWS\\twshotfixes.txt" or die "I could not open twshotfixed.txt";
$CUR_STATE = $WAIT_NAME;
@FIXES;
while(<TWSINPUT>)
{
if($CUR_STATE == $WAIT_NAME && /^Server\ Name\:\ (.+)\n/)
{
print TWSOUTPUT "\n";
print TWSOUTPUT "$1";
chomp;
$CUR_STATE = $WAIT_FIX;
}
#if(/^Server\ Name\:\ (.+)\n/)
#{
# print TWSOUTPUT "$1";
# $CUR_STATE = $WAIT_FIX;
#}
elsif($CUR_STATE == $WAIT_FIX && /^Network\ Error\ (.+)\n/)
{
print TWSOUTPUT " $1\n";
chomp;
$CUR_STATE = $WAIT_NAME;
}
elsif($CUR_STATE == $WAIT_FIX && /^Hotfixes/)
{
$CUR_STATE = $WAIT_DRIVE;
}
elsif($CUR_STATE == $WAIT_DRIVE && /^Drive/)
{
$CUR_STATE = $WAIT_NAME;
print TWSOUTPUT "@FIXES\n";
chomp;
}
elsif($CUR_STATE == $WAIT_DRIVE && /^Network/)
{
$CUR_STATE = $WAIT_NAME;
print TWSOUTPUT "@FIXES\n";
chomp;
}
elsif($CUR_STATE == $WAIT_DRIVE && /^Protocols/)
{
$CUR_STATE = $WAIT_NAME;
print TWSOUTPUT "@FIXES\n";
chomp;
}
elsif($CUR_STATE == $WAIT_DRIVE && /\[(.+)\]\:/)
{
push (@FIXES, ",$1"
}
else
{
# die "INVALID DATA:$_";
}
}
close TWSINPUT;
close TWSOUTPUT;
#Team Workstation needed hotfixes Section
print "Backing up old twsneed.txt... \n";
rename ("twsneed.txt", "C\:\\perl_scripts\\srvinfopc\\txtfiles\\TWS\\bac\\twsneed.bac" || die "Cannot rename twsneed.txt: $!";
print "looking for Team Workstations without listed hotfixes. Please be patient.\n";
open (HOTLIST, "hotlist.txt" or die "I could not open hotlist as input";
open (TWSNEEDLIST, ">>twsneed.txt" or die "I cannot open twsneed.txt as output";
my $time;
$time = localtime(time());
print TWSNEEDLIST "$time.---------------------------------------------------------------\n\n";
while(<HOTLIST>)
{
chomp;
my $fix;
$fix=$_;
print "$fix \n";
print TWSNEEDLIST "hotfix: $fix \n\n";
my $hots;
$hots = `findstr -v $fix C\:\\perl_scripts\\srvinfopc\\txtfiles\\TWS\\twshotfixes.txt`;
print TWSNEEDLIST "$hots\n\n";
print TWSNEEDLIST "==============================================================================\n\n";
}
close HOTLIST;
close TWSNEEDLIST;
Now that you see that I will show you what my other inputs look like.
TWSPCINFO.txt:
rrc7850-desk
rrc7299-desk
rrc7793-desk
TWSSRVIFO.txt:
Thu Jan 1 11:03:15 2004.---------------------------------------------------------------
Server Name: rrc7850-desk
Server Name: rrc7850-desk
Security: Users
Registered Owner: (omited)
Registered Organization: (Omited)
ProductID: (Omited)
Original Install Date: Sat Nov 29 11:09:41 2003
Base Source Path: C:\drivers\i386
Service Pack Source Path: D:Version: 5.1
Build: (omited)
Current Type: Uniprocessor Free
Product Name: Microsoft Windows XP
Product Options: Professional
HAL.DLL is (omited)
PDC: (omited)
Domain: (omited)
Domain Guid: (omited)
DNS Forest Name: (omited)
PDC Site Name: (omited)
Computer Site Name: (omited)
CPU[0]: x86 Family 6 Model 8 Stepping 6: 930 MHz
System BIOS Date: 09/21/00
System BIOS Version: IBM - 1010, IBM BIOS Ver PIKT24.0
Hotfixes:
Windows XP:
SP2
[KB823559]: Installed on 11/29/2003 by Administrator
[KB824146] Installed on 11/29/2003 by Administrator
[Q323255]: Installed on 4/7/2003 by Administrator
[Q328310]: Installed on 4/7/2003 by Administrator
[Q329390]: Installed on 4/7/2003 by Administrator
[Q331953]: Installed on 11/29/2003 by Administrator
[Q810097]: Installed on 4/7/2003 by Administrator
[Q810833]: Installed on 11/29/2003 by Administrator
[Q815021]: Installed on 11/29/2003 by Administrator
[Q816556]: Installed on 11/29/2003 by Administrator
[Q817606]: Installed on 11/29/2003 by Administrator
Windows Media Player:
wm817787
[FileList]: Installed on ??/??/?? by Unknown
Drive: [FileSys] [ Size ] [ Free ] [ Used ]
C$ NTFS 19470 14310 5160
Network Card [0]: IBM 10/100 EtherJet PCI Management Adapter
IP Address(es): (omited)
MAC Address: (omited)
Protocols:
Layer 2 Tunneling Protocol
Remote Access NDIS WAN Driver
Point to Point Tunneling Protocol
WINS Client(TCP/IP) Protocol
Internet Protocol (TCP/IP)
Point to Point Protocol Over Ethernet
NDIS Usermode I/O Protocol
Message-oriented TCP/IP Protocol (SMB session)
System Up Time: 0 Days, 6 Hr, 54 Min, 51 Sec
===========================
Server Name: rrc7299-desk
Server Name: rrc7299-desk
Security: Users
Registered Owner: (omited)
Registered Organization: (omited)
ProductID: (omited)
Original Install Date: Fri Jun 27 11:09:30 2003
Base Source Path: (omited)
Service Pack Source Path: c:\push
Version: 5.0
Build: 2195, Service Pack 4
Current Type: Uniprocessor Free
Product Name: Microsoft Windows 2000
Product Options: Professional
HAL.DLL is (omited)
PDC: (omited)
Domain: (omited)
Domain Guid: (omited)
DNS Forest Name: (omited)
PDC Site Name: (omited)
Computer Site Name: (omited)
CPU[0]: x86 Family 6 Model 8 Stepping 6: 930 MHz
System BIOS Date: 09/21/00
System BIOS Version: IBM BIOS Ver PIKT24.0
Hotfixes:
Windows Media Player:
wm320920.1
[FileList]: Installed on ??/??/?? by Unknown
Windows 2000:
SP4
[Q327194]: Installed on 12/27/2003 by SYSTEM
SP5
[KB823559]: Installed on 12/27/2003 by SYSTEM
[KB823980]: Installed on 8/7/2003 by jmdykstr
[KB824146]: Installed on 9/20/2003 by jmdykstr
[KB828035]: Installed on 12/1/2003 by SYSTEM
[KB828749]: Installed on 12/3/2003 by SYSTEM
DataAccess:
Q323264
Q329414-25
Drive: [FileSys] [ Size ] [ Free ] [ Used ]
C$ NTFS 8229 3735 4494
Network Card [0]: IBM 10/100 EtherJet PCI Management Adapter
IP Address(es): (omited)
MAC Address: (omited)
Protocols:
Message-oriented TCP/IP Protocol (SMB session)
Remote Access NDIS WAN Driver
Point to Point Tunneling Protocol
Layer 2 Tunneling Protocol
WINS Client(TCP/IP) Protocol
Internet Protocol (TCP/IP)
NDIS Usermode I/O Protocol
System Up Time: 2 Days, 5 Hr, 8 Min, 46 Sec
===========================
Server Name: rrc7793-desk
Server Name: rrc7793-desk
Security: Users
Registered Owner: (omited)
Registered Organization: (omited)
ProductID: (omited)
Original Install Date: Fri Jun 27 11:09:30 2003
Base Source Path: (omited)
Service Pack Source Path: D:Version: 5.0
Build: 2195, Service Pack 3
Current Type: Uniprocessor Free
Product Name: Microsoft Windows 2000
Product Options: Professional
HAL.DLL is (omited)
PDC: (omited)
Domain: (omited)
Domain Guid: (omited)
DNS Forest Name: (omited)
PDC Site Name: (omited)
Computer Site Name: (omited)
CPU[0]: x86 Family 6 Model 8 Stepping 6: 930 MHz
System BIOS Date: 09/21/00
System BIOS Version: IBM BIOS Ver PIKT24.0
Hotfixes:
Windows Media Player:
wm320920.1
[FileList]: Installed on ??/??/?? by Unknown
Windows 2000:
SP4
[Q323255]: Installed on 6/27/2003 by Administrator
[Q326830]: Installed on 6/27/2003 by Administrator
[Q328310] Installed on 6/27/2003 by Administrator
[Q331953]: Installed on 6/27/2003 by Administrator
[Q810030]: Installed on 6/27/2003 by Administrator
[Q810833]: Installed on 6/27/2003 by Administrator
[Q815021]: Installed on 8/21/2003 by
SP5
[KB823980]: Installed on 8/7/2003 by
[KB824146]: Installed on 9/20/2003 by
[KB828035]: Installed on 11/26/2003 by SYSTEM
[KB828749]: Installed on 12/3/2003 by SYSTEM
DataAccess:
Q323264
Q329414-25
Drive: [FileSys] [ Size ] [ Free ] [ Used ]
C$ NTFS 11006 6149 4857
G$ FAT32 4111 2307 1804
Network Card [0]: IBM 10/100 EtherJet PCI Management Adapter
IP Address(es): (omited)
MAC Address: (omited)
Protocols:
Message-oriented TCP/IP Protocol (SMB session)
Remote Access NDIS WAN Driver
Point to Point Tunneling Protocol
Layer 2 Tunneling Protocol
WINS Client(TCP/IP) Protocol
Internet Protocol (TCP/IP)
System Up Time: 0 Days, 9 Hr, 44 Min, 25 Sec
===========================
TWSHOTFIXES.txt
rrc7850-desk,KB823559 ,KB824146 ,Q323255 ,Q328310 ,Q329390 ,Q331953 ,Q810097 ,Q810833 ,Q815021 ,Q816556 ,Q817606 ,FileList
rrc7299-desk,KB823559 ,KB824146 ,Q323255 ,Q328310 ,Q329390 ,Q331953 ,Q810097 ,Q810833 ,Q815021 ,Q816556 ,Q817606 ,FileList ,FileList ,Q327194 ,KB823559 ,KB823980 ,KB824146 ,KB828035 ,KB828749
rrc7793-desk,KB823559 ,KB824146 ,Q323255 ,Q328310 ,Q329390 ,Q331953 ,Q810097 ,Q810833 ,Q815021 ,Q816556 ,Q817606 ,FileList ,FileList ,Q327194 ,KB823559 ,KB823980 ,KB824146 ,KB828035 ,KB828749 ,FileList ,Q323255 ,Q326830 ,Q328310 ,Q331953 ,Q810030 ,Q810833 ,Q815021 ,KB823980 ,KB824146 ,KB828035 ,KB828749
HOTLIST.txt:
828035
828749
815021
TWSNEED.txt
Thu Jan 1 11:16:18 2004.---------------------------------------------------------------
hotfix: 828035
rrc7850-desk,KB823559 ,KB824146 ,Q323255 ,Q328310 ,Q329390 ,Q331953 ,Q810097 ,Q810833 ,Q815021 ,Q816556 ,Q817606 ,FileList
==============================================================================
hotfix: 828749
rrc7850-desk,KB823559 ,KB824146 ,Q323255 ,Q328310 ,Q329390 ,Q331953 ,Q810097 ,Q810833 ,Q815021 ,Q816556 ,Q817606 ,FileList
==============================================================================
hotfix: 815021
==============================================================================
Of course anythign that could possibly be confidential to Intel has been omited. I also added in bold red the information I want to grab from the TWSSRVINFO.txt file.
OK, now you have all the text files that are created and what i see when it is finalized inall areas.
The problem I am having is that TWSHOTFIXES seems to be duplcating and not chomping something off. This means when the last one runs, it will not show me a system that needs the hotfixes because the files say it does, and that is only because it is retaining the information from the start.
I have tried adding a chomp to the beginning of the while loop and that does not work at all, I just get a sheet with the hotfixes name on it in the end.
Anyone out there that can take a look at thisand tell me what I am doing wrong? I am so lost now, it took me forever to get this far and now I feel dumb cause i cant figure this out.
(FYI: the script is written like it is because I am new, I did not try to condense it to make it shorter, I just wanted to see what each part looks like when it is done and then maybe in about a hundred years when I am proficient in perl I will condense it down if it is possible)
I want to thank you gusy in advance if you can help me. (If this script works, I save hours of time manually going System by system to see if someone has installed a patch)