????? ??????? ?????? ??? ?????? ??????? ?????? ??????? ??? 824146 (MS03-039) ?? ????? ?????? 823980 (MS03-026) ??? ????? ????????? ?????? ??????

?????? ????????? ?????? ?????????
???? ???????: 827227 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

????? ??? ??????? ?????? ??? ????? Microsoft Visual Basic Scripting Edition ?????? Patchinstall.vbs. ??? ???????? ????? ?? ???? ?? ????? ??????? ????? ???? Windows Management Instrumentation (WMI) ??????? ?????? ?????? ??????? ??? 824146 (MS03-039) ?? ????? ?????? 823980 (MS03-026) ??? ????? ????????? ?????? ?????? ???? ?? ??? ????? ????? ?? ???? ???? Microsoft Windows NT ?? Windows 2000 ?? Windows Server 2003. ?????? ???????? ????? Patchinstall.vbs ??? (Ipfile.txt) ???? ????? ??? ?????? IP ?????? ??? ?????? (MS03-039) ?? ????? ?????? 823980 (MS03-026) ?? ???? ????? ??? ????????? ?????? ?????? (C:\Patchinst.exe) ???????. ?????? ??? ??????? ?????? ??? ????? ?????? ??? 824146 (MS03-039) ? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
824146MS03-039: ?????? ?????? ????? ?? RPCSS ?? ?????? ????????? ????????
?????? ??? ??????? ?????? ??? ????? ?????? 823980 ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
823980MS03-026: ?? ???? ?????? ?????? ????? ?? RPC ?????? ????????? ????????
?????? ??? ??????? ?????? ??? ???? ???? ??????? ??????? ????????? ????? ??????? ?????? ??? ?????? ????????? ???? ?? ??? ????? ??????? ?????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
827363????? ??????? 824146 ???????? ???? ???? ?????? ??? ????? ????????? ??????? ???? ??? ??? ??? ?????? (MS03-039) ?????? ??????? ????? ?? ??? ?????? (MS03-026)

?????????

  • ??? ?? ???? ???? ?????? ?????? ??? ??????? ?????? ??????? ?????? ??????? ??? 824146 ?? ????? ?????? 823980 ?????.
  • ?????? Microsoft ????? ????????? ?????? ????? ??? ???? ??????? Windows XP ??? ?? ???? ?????? ??? ???? Windows NT ?? Windows 2000 ?? Windows Server 2003 ??? ????? ???????? ????? Patchinstall.vbs.
  • ?????? ???????? ????? Patchinstall.vbs Windows Management Instrumentation (WMI). ????? WMI ?????? ??????? ??? ??????? ???????? (DCOM). ????? ?? ???? Patchinstall.vbs ??? ??????? ?????? ???? ?? ????? DCOM ??????? ?????? ??? ????? ??? ??????? ???? ??? ???????? ????? ???? Microsoft MS03-039 ?? MS03-026.
  • ??? ?? ???? ??? ?????? ?? ??? ????? ?????? 823980 ??????? ?? ???? ???? ??? ????????? ??? ????? ???????? ????? Patchinstall.vbs ? ??? ?? ???? ????? ????? ????? Patch_XP.exe (?? Windows XP) ?? Patch_W2K.exe (????? ??????? Windows 2000) Patch_W2K3.exe (????? ??????? Windows Server 2003).
  • ????? ????? ???????? ????? Patchinstall.vbs ????? ??????? ????.

??????? ????

???????? ????? Patchinstall.vbs ?????? ??? ??????:
  • ???? ???????? ????? ?????? ????? ?????? IP ?????? ????????? ?????? ?????? ???? ???? ????? ??????? ??? 824146 ?? ????? ?????? 823980. ???????? ????? ???? ??? ??????? ?? ??? ??? ASCII (Ipfile.txt) ???? ????? ??? ????? ????? IP (????? IP ???? ?? ?? ???). ??? ???? ??????? ????? ??????? ??? ??? Vulnerable.txt ?? ???? ????? KB824146 ???? Ipfile.txt.
  • ???????? ????? ???? ??? ????? IP ????? ?? ???????.
  • ???? ???????? ????? ????? Windows ??? ????????? ??????.
  • ????? ???????? ????? ???? ??????? Z ??? ????????? ???????? ????? ??? C $ ??? ????????? ??????.
  • ???????? ????? ??? ??????? ?????? ?? ??????? (?? Windows XP ?? Windows 2000 ?? Windows Server 2003) ??? C:\Patchinst.exe ??? ????????? ?????? (???????? ????? ???? ??????? Z).
  • ????? ????? ????? ???????? ????? ??? ?? ???????? ??? ????? ????? ????? ????????? ?????? ???? ?? ????? ???????? ?? ???? ?????? ????? ???????? -q -f ???? ??????? (??? ??????? ??? ???????).
  • ?????? ???????? ????? ??? ????? ???????.
  • ????? ???????? ????? ??? ????? C:\Patchinst.exe ??? ????????? ??????.
  • ???? ???????? ????? ????? ???? ??????? Z.
  • ????? ???????? ????? ????? IP ?????? ?? ???????.
??? ???? Microsoft ????? ??? ???????? ????? ???????? ???? ???? ??????? ??? ?? ?????? ???????? ????? ?? ???? ?????? ??? ???????? ?? ???? ?????.

???????? ?????? ??? Patchinstall.vbs ??? ???????? ????? ?????? ?? ??? ??? ???? Patchinstall.vbs. ??? ???? ?? ?????? ???????? ????? Patchinstall.vbs ???????? ??? ??????? ??????:
patchinstall.vbs cscript LocalPathToPatches Ipfile.txt
?? ??? ?????? Ipfile.txt ?? ??? ??? ????? ??? ????? ?????? IP ?????? ????????? ?????? ?????? ???? ???? ????? ??????? ??? 824146 ?? ????? ?????? 823980. LocalPathToPatches ?? ?????? ?????? ?????? ???? ????? ??? ??? ?????? ?? ??? ????? ?????? 823980 (??????? ??? Patch_XP.exe ?? Windows XP Patch_W2k.exe ?? Windows 2000 Patch_W2k3.exe ?? Windows Server 2003).

Script Patchinstall.vbs

???? Microsoft ??????? ???????? ??? ??? ?? ???? ??????? ?? ?? ?????. ??? ????? ???? ?? ????? ??? ???????? ??????? ?????? ???????? ?? ???????? ???? ????. ????? ??? ??????? ???? ?????? ?? ??? ??????? ???? ??? ????? ?? ??????? ???? ??? ????????? ?????? ?????? ?????????. ???? ??????? ????? ??? Microsoft ??? ????? ????? ???? ???? ?? ?????? ?????? ??? ??????? ?????? ????? ?????? ?? ????? ??????? ?????? ??????? ?????.
' Patchinstall.vbs
' Patch installation script for MS03-026 and MS03-039
' (c) Microsoft 2003
' v1.03 cl

on error resume next

const XP_Patch = "Patch_XP.exe"
const W2k_Patch = "Patch_W2k.exe"
const W2k3_Patch = "Patch_W2k3.exe"

If right(ucase(wscript.FullName),11)="WSCRIPT.EXE" then
     wscript.echo "ERROR: You must run this script using cscript, for example 'cscript " & wscript.scriptname & "'."
     wscript.quit 0
end if

' USAGE
if wscript.arguments.count <> 2 then
     wscript.echo "Usage: cscript " & wscript.scriptname & " <IpFile.txt> <LocalPathToPatches>" & vbCrLf & vbCrLf & _
     "  <LocalPathToPatches> must be a full path of a folder that contains all of these files:" & vbCrLf & _
     "      " & XP_Patch & vbCrLf & _ 
     "      " & W2k_Patch & vbCrLf & _ 
     "      " & W2k3_Patch
     wscript.quit
end if

ipFile = wscript.arguments(0)
localPathToPatches = wscript.arguments(1)

set onet = createobject("wscript.network")
set ofs = createobject("scripting.filesystemobject")

' Verify that ipfile is accessible.
set oipFile = ofs.opentextfile(ipFile, 1, false)
if (Err.Number <> 0) then
     wscript.echo "Cannot open " & ipFile
     wscript.quit
end if

' Make sure to end with a \ character.
if right(localPathToPatches, 1) <> "\" then
     localPathToPatches = localPathToPatches & "\"
end if

'Note that cim_datafile does not support UNC paths
'so everything must be handled through mapped drives.
if left(localPathToPatches, 2) = "\\" then
     wscript.echo "<pathToExecutable> cannot be a UNC path, please map a drive locally"
     wscript.quit
end if

exeWinXP = ofs.getfile(localPathToPatches + XP_Patch).name
exeW2k = ofs.getfile(localPathToPatches + W2k_Patch).name
exeW2k3 = ofs.getfile(localPathToPatches + W2k3_Patch).name

' Verify that the patches are accessible.
if ((len(exeWinXP) = 0) OR (len(exeW2k) = 0) OR (len(exeW2k3) = 0)) then
     wscript.echo "Cannot find patch files."
     wscript.echo "Please verify that the <LocalPathToPatches> folder contains all of these files:" & vbCrLf & _
     "      " & XP_Patch & vbCrLf & _ 
     "      " & W2k_Patch & vbCrLf & _ 
     "      " & W2k3_Patch
     wscript.quit
end if


set osvcLocal = getobject("winmgmts:root\cimv2")

'The error-handling code is below the function that may throw one - execute it.
on error resume next

while not oipFile.atEndOfStream
     ip = oipFile.ReadLine()
     wscript.echo vbCrLf & "Connecting to " & ip & "..."

     Err.Clear
     set osvcRemote = GetObject("winmgmts:\\" & ip & "\root\cimv2")

     if (Err.Number <> 0) then
          wscript.echo "Failed to connect to " & ip & "."
     else

          exeCorrectPatch = detectOSPatch(osvcRemote)
          if (exeCorrectPatch <> "") then
               ' Lay the bits on the remote computer.
               wscript.echo "Installing patch " & exeCorrectPatch & "..."

               onet.mapnetworkdrive "z:", "\\" & ip & "\C$"
               set osourceFile = osvcLocal.get("cim_datafile=""" & replace(localPathToPatches, "\", "\\") & exeCorrectPatch & """")
               ret = osourceFile.Copy("z:\\Patchinst.exe")

               if (ret <> 0 and ret <> 10) then
                    ' Failure detected and failure was not "file already exists."
                    wscript.echo "Failed copy to " & ip & " - error: " & ret
               else
                    set oprocess = osvcRemote.Get("win32_process")
     
                    ' Start the installation without user interaction, and force a restart after completion.
                    ret = oprocess.create("c:\\Patchinst.exe -q -f")
                    if (ret <> 0) then
                         wscript.echo "Failed to start process on " & ip & ": " & ret
                    else
                         ' Get a reference to the file that was copied.
                         set odestFile = osvcLocal.get("cim_datafile=""z:\\Patchinst.exe""")

                         ' Wait for the installation to complete.
                         for waitTime = 0 to 120     ' Lay and wait--up to two minutes for the installation to complete.
                              wscript.Sleep 1000     ' Sleep one second.
                              ' Delete temporary file as soon as possible after it is freed.
                              if (odestFile.Delete() = 0) then
                                   exit for
                              end if
                         next ' Otherwise, loop again and keep waiting...

                         wscript.echo "Installation successful."

                    end if     'Create process succeeded.
               end if     'Copy succeeded.

               onet.removenetworkdrive "z:", true
          end if      ' The script knows which patch to install.
     end if ' Do the next IP address, then the next IP address... 
wend

oipFile.close()

'Clean up, remove drive mapping (check this time, because it may not have been mapped).
if ofs.folderexists("z:\") then
     onet.removenetworkdrive "z:", true
end if

wscript.echo vbCrLf & "Patching complete. Exiting."

function detectOSPatch(osvcRemote)

     set oOSInfo = osvcRemote.InstancesOf("Win32_OperatingSystem")
     'Only one instance is ever returned (the currently active OS), even though the following is a foreach.
     for each objOperatingSystem in oOSInfo

          if (objOperatingSystem.OSType <> 18) then
               ' Make sure that this computer is Windows NT-based.
               wscript.echo ip & " is not a Windows XP, Windows 2000, or Windows 2003 Server computer."
          else
               if (objOperatingSystem.Version = "5.0.2195") then
                    ' Windows 2000 SP2, SP3, SP4.
                    if (objOperatingSystem.ServicePackMajorVersion = 2) or (objOperatingSystem.ServicePackMajorVersion = 3) or _
			(objOperatingSystem.ServicePackMajorVersion = 4) then
                         systemType = exeW2k
                    end if

               elseif (objOperatingSystem.Version = "5.1.2600") then
                    ' Windows XP RTM, SP1.
                    if (objOperatingSystem.ServicePackMajorVersion = 0) or (objOperatingSystem.ServicePackMajorVersion = 1) then
                         systemType = exeWinXP
                    end if

               elseif (objOperatingSystem.Version = "5.2.3790") then
                    ' Windows Server 2003 RTM
                    if (objOperatingSystem.ServicePackMajorVersion = 0) then
                         systemType = exeW2k3
                    end if
               end if

               if (systemType = "") then 
                    'This was a Windows NT-based computer, but not with a valid service pack.
                    wscript.echo "Could not patch " & ip & " - unhandled OS version: " & objOperatingSystem.Caption & " SP" & _
				objOperatingSystem.ServicePackMajorVersion & "("& objOperatingSystem.Version & ")"
               end if
          end if

     next

     detectOSPatch = systemType

end function

???????

???? ???????: 827227 - ????? ??? ??????: 23/?????/1428 - ??????: 5.6
????? ???
  • Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
  • Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
  • Microsoft Windows Server 2003, Standard Edition (32-bit x86)
  • Microsoft Windows Server 2003, Web Edition
  • Microsoft Windows XP Professional
  • Microsoft Windows XP Tablet PC Edition
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional Edition
  • Microsoft Windows 2000 Server
????? ??????: 
kbmt kbinfo KB827227 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????827227

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com