Войти

Показать полную графическую версию : Установка через GPO определённой KB (943729). WSUS нет.


Страниц : 1 [2]

PIL123
05-07-2012, 23:15
Поправлю на днях. »
ОК, спасибо! Возлагаю на Вас и Ваш скрипт большие надежды, ибо уже продакшн :-)

PIL123
18-07-2012, 00:51
Iska, :-( Вернитесь, пожалуйста, в мой топик...

PIL123
18-07-2012, 01:25
Iska, я решил использовать Ваш скрипт для разворачивания в сети Internet Explorer'ов. Начал с того, что на своей домашней машине опробовал этот Ваш хитрый запрос:

http://clip2net.com/clip/m19972/thumb640/1342559971-clip-33kb.jpg (http://clip2net.com/s/27VN5)

При этом вводил заведомо имеющиеся у меня KB'шки:

http://clip2net.com/clip/m19972/thumb640/1342559925-clip-127kb.jpg (http://clip2net.com/s/27VMP)

В ответ на команду получал, что данный KB не установлен. Подскажите, что я делаю не так? Ну, и следом, подскажите, пожалуйста, как, используя Ваш хитрый запрос определить установлен ли Internet Explorer на компьютере?

Iska
18-07-2012, 02:28
Iska, :-( Вернитесь, пожалуйста, в мой топик... »
Я вернусь, когда появится достаточное количество потребного времени в нужном месте. Пока что эти обстоятельства не совпадают. Сожалею.

При этом вводил заведомо имеющиеся у меня KB'шки:

В ответ на команду получал, что данный KB не установлен. »
Вот краткая выдержка типичных значений из:
wmic.exe QFE get HotFixID, ServicePackInEffect
HotFixID ServicePackInEffect
File 1 KB2510581
File 1 KB888111WXPSP2
File 1 KB932716-v2
File 1 KB942288-v3
File 1 KB952011
File 1 KB954550-v5
Q147222
Q282784
S867460 1.1
KB968930 SP10
Q282784 SP1
KB969084 SP10
KB952011 SP3
KB2647516 SP4
KB932716-v2 SP4
KB942288-v3 SP4
KB954550-v5 SP4
KB955704 SP4

Пара «HotFixID/ServicePackInEffect» однозначно идентифицируют установленное обновление в коллекции класса. И Вам надо для каждой конкретно взятой версии каждого обновления предварительно определить эти квалификаторы.

Выполните такую команду:
wmic.exe QFE get HotFixID, ServicePackInEffect | find.exe "KB2719985"
на машине с установленным обновлением KB2719985. Вы должны увидеть пару значений. Первое — это квалификатор «HotFixID», второе — «ServicePackInEffect». Их и используйте.

Ну, и следом, подскажите, пожалуйста, как, используя Ваш хитрый запрос определить установлен ли Internet Explorer на компьютере? »
А может быть такое, что он не установлен под Windows?!

PIL123
18-07-2012, 12:53
А может быть такое, что он не установлен под Windows?! »
Он конечно в любом случае (почти) будет установлен, но какой-либо предыдущей версии. Хотелось бы проверять установлен ли та версия, которая нужна (последняя для каждой конкретной ОС) и, в случае, если не установлена последняя версия - ставить её.

Ввёл Ваши команды, но пары значений у меня не вывалилось почему-то :-(

http://clip2net.com/clip/m19972/thumb640/1342601119-clip-5kb.png (http://clip2net.com/s/27YO1)

http://clip2net.com/clip/m19972/thumb640/1342601307-clip-19kb.png (http://clip2net.com/s/27YPV)

Подскажите, пожалуйста, как быть?

Iska
18-07-2012, 13:15
Проверьте так:
wmic.exe QFE where "HotFixID='KB2719985' AND ServicePackInEffect=''" get HotFixID, ServicePackInEffect, Description

Если находится экземпляр класса — то так и пробуйте:
strHotFixID = "KB2719985"
strServicePackInEffect = ""

PIL123
18-07-2012, 13:31
Iska, всё получилось:

http://clip2net.com/clip/m19972/thumb640/1342603654-clip-35kb.jpg (http://clip2net.com/s/27ZhJ)

Спасибо! Смотрю теперь как это знание прикрутить к возможности определения факта наличия/отсутствия требуемого IE.

PIL123
18-07-2012, 14:32
Iska, Вы случайно не знаете какой HotFixID имеют IE 8 и IE9. Не знаю как их определить. Щас гуглю и в технете уже копаюсь, но пока безрезультатно. Может быть IE нужно определять как-то, используя какой-то другой WMI-запрос?

Тема уходит в сторону от темы топика - как считаете, может создать новый топик, посвящённый определению установленного/не установленного последнего IE для каждой отдельно взятой ОС?

Iska
19-07-2012, 19:52
Iska, Вы случайно не знаете какой HotFixID имеют IE 8 и IE9. Не знаю как их определить. Щас гуглю и в технете уже копаюсь, но пока безрезультатно. Может быть IE нужно определять как-то, используя какой-то другой WMI-запрос? »
PIL123, вот потому-то у меня и не возникало ни малейшего желания лепить свой WSUS — ибо я знал, что такой вопрос, рано или поздно, возникнет. Вы хотите устанавливать кумулятивные обновления для IE?

PIL123
19-07-2012, 22:27
Нет - не кумулятивные обновления, а только IE. Я работаю у заказчика и, как часть работ, надо установить последний IE для каждой ОС - Для Seven - это IE9, для XP - IE8 и т.д. Отсюда желание развернуть эти вещи скриптом. А WSUS у заказчика нет - такой вот хреновый заказчик :-(

sattva
31-05-2013, 11:19
У меня работает такой универсальный вариант

' --------------------------------------------- '
' ----- By Jakob H. Heidelberg 29-02-2008 ----- '
' ----- - - - - - - - - - - - - - - - - - ----- '
' ----- Install GP Preference CSEs ----- '
' ----- Developed for: ----- '
' ----- http://heidelbergit.blogspot.com ----- '
' ----- - - - - - - - - - - - - - - - - - ----- '
' ----- version 1.01 ----- '
' ----- Last rev. date: 01-03-2008 ----- '
' --------------------------------------------- '
' Changes:
'---------
' v1.0 Basic functionality:
' - Developed to be combined with a Startup Script (or admin rights)
' - Check if the CSEs are installed already, using local WMI call
' - Check OS Version (Windows XP, Windows Server 2003, Windows Vista), using local WMI call
' - Check OS Architecture (32 or 64 bit), just checking for a folder as WMI call was kinda strange
' - Check OS Service Pack Level, using local WMI call
' - Check for GPP CSE Pre-requisite on XP/2003 systems, using local WMI call
' - Installation of GPP CSE Pre-reqs on XP/2003 systems
' - Handles install on Windows XP SP2/SP3 32-bit (EXE file)
' - Handles install on Windows XP 64-bit, any SP level (EXE file)
' - Handles install on Windows Server 2003 SP1/SP2 32-bit (EXE file)
' - Handles install on Windows Server 2003 64-bit, any SP level (EXE file)
' - Handles install on Windows Vista RTM/SP1 32-bit (MSU package)
' - Handles install on Windows Vista RTM/SP1 64-bit (MSU package)
'
'More info:
'----------
' 1) Place ALL GPP CSE and GPP CSE Pre-Req files in the same directory (strBasePath), eg. \\DC1\UPDATES\
' 2) Description of the Windows Update Stand-alone Installer (Wusa.exe) and of .msu files in Windows Vista:
' http://support.microsoft.com/kb/934307/en-us
' 3) NB! You might need other language version for the XmlLite GPP CSE Pre-requisites, so watch out!

Option Explicit
On Error Resume Next

'The Group Policy Preference CSE HotfixID
Dim strCSEFixID : strCSEFixID ="943729"

'Path to main update share/folder - place the 4 GPP CSE and the 3 GPP CSE Pre-Req binaries here!
Dim strBasePath : strBasePath = "\\192.168.1.92\SoftInstall$\Update\KB943729\" 'NB! with trailing backslash!

'GPP CSE filename for: Windows XP 32-bit / Windows Server 2003 32-bit (MD5: dfa20e51141af67ec49d574428c38fb8)
'http://www.microsoft.com/downloads/details.aspx?FamilyID=e60b5c8f-d7dc-4b27-a261-247ce3f6c4f8&DisplayLang=en
'http://www.microsoft.com/downloads/details.aspx?FamilyID=bfe775f9-5c34-44d0-8a94-44e47db35add&DisplayLang=en
Dim strXP2K332CSE : strXP2K332CSE = "WindowsXP-KB943729-x86-RUS.exe"

'GPP CSE filename for: Windows XP 64-bit / Windows Server 2003 64-bit (MD5: 5803c6f4b4bc02ea29d934d839e0a66f)
'http://www.microsoft.com/downloads/details.aspx?FamilyID=b10a7af4-8bee-4adc-8bbe-9949df77a3cf&DisplayLang=en
'http://www.microsoft.com/downloads/details.aspx?FamilyID=29e83503-7686-49f3-b42d-8e5ed23d5d79&DisplayLang=en
Dim strXP2K364CSE : strXP2K364CSE = "WindowsXP-KB943729-x64-RUS.exe"

'GPP CSE filename for: Windows Vista 32-bit (MD5: 22a42082473b3c8bc3b22ad095c6c31f)
'http://www.microsoft.com/downloads/details.aspx?FamilyID=ab60dc87-884c-46d5-82cd-f3c299dac7cc&DisplayLang=en
Dim strVIS32CSE : strVIS32CSE = "Windows6.0-KB943729-x86.msu"

'GPP CSE filename for: Windows Vista 64-bit (MD5: d92e107cdffa51d5943f1861f28178e7)
'http://www.microsoft.com/downloads/details.aspx?FamilyID=b10a7af4-8bee-4adc-8bbe-9949df77a3cf&DisplayLang=en
Dim strVIS64CSE : strVIS64CSE = "Windows6.0-KB943729-x64.msu"

'----------------------------------------------------------------------'
'PRE-REQUISITES - 'http://support.microsoft.com/default.aspx/kb/914783 '
'----------------------------------------------------------------------'
'GPP PreReq KB914783 filename for: Windows XP SP2 32-bit = KB915865 (MD5: 656657aeaea02d3a1069d52c4593e6e8)
'http://www.microsoft.com/downloads/details.aspx?FamilyId=D7B5DC81-AD14-4DE2-8AD5-8C4A9AAB5992&displaylang=en
Dim strXP32PRE : strXP32PRE = "WindowsXP-KB915865-v11-x86-RUS.exe"
Dim strPREFixID1 : strPREFixID1 = "915865"

'GPP PreReq KB914783 filename for: Windows Server 2003 SP1 32-bit = KB914783 (MD5: 830c6163fa113b782aa3cd9eb54ee549)
'http://www.microsoft.com/downloads/details.aspx?FamilyId=611D1FDE-C8D0-4D80-96DA-B5B20F7BA159&displaylang=en
Dim str2K332PRE : str2K332PRE = "WindowsServer2003-KB914783-v10-x86-RUS.exe"
Dim strPREFixID2 : strPREFixID2 = "914783"

'GPP PreReq KB914783 filename for: Windows XP 64-bit = KB915865 (MD5: 7fd3fc3fb21566fd97750d98e41bca0d)
'http://www.microsoft.com/downloads/details.aspx?FamilyId=C7CB26E9-68F1-4F80-B231-79D044431E8E&displaylang=en
Dim strPREFixID3 : strPREFixID3 = "915865" 'exact same install file as Windows Server 2003 SP1 64-bit (KB914783)

'GPP PreReq KB914783 filename for: Windows Server 2003 SP1 64-bit = KB914783 (MD5: 7fd3fc3fb21566fd97750d98e41bca0d)
'http://www.microsoft.com/downloads/details.aspx?FamilyId=406777E6-79DA-4414-A329-22A435A95D9D&displaylang=en
Dim strXP2K364PRE : strXP2K364PRE = "WindowsServer2003.WindowsXP-KB914783-v10-x64-ENU.exe"
Dim strPREFixID4 : strPREFixID4 = "914783"

'Commandline stuff
Dim strArgusMSU : strArgusMSU = "/quiet /norestart"
Dim strArgusEXE : strArgusEXE = "/quiet /passive /norestart"
Dim strArgusLOG : strArgusLOG = "/log:\\192.168.1.92\SoftInstall$\Update\KB943729\Logs\KB943729_" & WScript.CreateObject("WScript.Network").ComputerName & ".log"

Dim objFso : Set objFso = CreateObject("Scripting.FileSystemObject")

'Get SYSTEM folder, eg. C:\Windows\System32
Dim strSys : strSys = objFSO.GetSpecialFolder(1)

'Is the GPP CSE already installed? Is so, then just quit!
If IsThisHotfixInstalled(strCSEFixID) Then WScript.Quit(0)

'Is this a 64-bit windows OS?
'Get WINDOWS folder, eg. C:\Windows
Dim strWin : strWin = objFSO.GetSpecialFolder(0)
Dim strBit : strBit = "32"
If objFso.FolderExists(strWin & "\SysWOW64") Then strBit = "64"

Set objFso = Nothing

'Get OS version and Service Pack level using WMI
Dim strCSDVers, strCaption
Dim objWMI : Set objWMI = GetObject("winmgmts:\\.\root\CIMV2")
Dim colItm : Set colItm = objWMI.ExecQuery("SELECT * FROM Win32_OperatingSystem")
Dim objItm
For Each objItm In colItm
strCSDVers = objItm.CSDVersion
strCaption = objItm.Caption
Next
Set objWMI = Nothing
Set colItm = Nothing

'GET OS ARCHITECTURE
If Instr(strBit, "32") Then
strBit = "32"
ElseIf Instr(strBit, "64") Then
strBit = "64"
Else
'We don't know what OS architecture it is, let's beat it...
WScript.Quit()
End If

'GET SP LEVEL (number only)
If strCSDVers <> "" Then
strCSDVers = Right(strCSDVers,1)
End If

Dim strCommandLineCSE, strCommandLinePRE
'GET OS VERSION (CAPTION) and Build CommandLine
If Instr(UCASE(strCaption), "VISTA") Then
'We are dealing with a Windows Vista system
If strBit = "32" Then
'This is 32 bit (no SP level check)
'No pre-req check for Windows Vista
strCommandLineCSE = strSys & "\WUSA.EXE " & Chr(34) & strBasePath & strVIS32CSE & Chr(34) & " " & strArgusMSU & " " & strArgusLOG
ElseIf strBit = "64" Then
'This is 64 bit (no SP level check)
'No pre-req check for Windows Vista
strCommandLineCSE = strSys & "\WUSA.EXE " & Chr(34) & strBasePath & strVIS64CSE & Chr(34) & " " & strArgusMSU & " " & strArgusLOG
End If

ElseIf Instr(UCASE(strCaption), "XP") Then
'We are dealing with a Windows XP system
If (strCSDVers = "2" Or strCSDVers = "3")And strBit = "32" Then
'This is SP2 or SP3 - 32 bit
'Install pre-req if it's not already there
If Not IsThisHotfixInstalled(strPREFixID1) Then strCommandLinePRE = Chr(34) & strBasePath & strXP32PRE & Chr(34) & " " & strArgusEXE & " " & strArgusLOG
strCommandLineCSE = Chr(34) & strBasePath & strXP2K332CSE & Chr(34) & " " & strArgusEXE & " " & strArgusLOG
ElseIf strBit = "64" Then
'This is 64 bit (no SP level check)
'Install pre-req if it's not already there
If Not IsThisHotfixInstalled(strPREFixID3) Then strCommandLinePRE = Chr(34) & strBasePath & strXP2K364PRE & Chr(34) & " " & strArgusEXE & " " & strArgusLOG
strCommandLineCSE = Chr(34) & strBasePath & strXP2K364CSE & Chr(34) & " " & strArgusEXE & " " & strArgusLOG
End If

ElseIf Instr(strCaption, "2003") Then
'We are dealing with a Windows Server 2003 system
If (strCSDVers = "1" Or strCSDVers = "2") And strBit = "32" Then
'This is SP1 or SP2 - 32 bit
'Install pre-req if it's not already there
If Not IsThisHotfixInstalled(strPREFixID2) Then strCommandLinePRE = Chr(34) & strBasePath & str2K332PRE & Chr(34) & " " & strArgusEXE & " " & strArgusLOG
strCommandLineCSE = Chr(34) & strBasePath & strXP2K332CSE & Chr(34) & " " & strArgusEXE & " " & strArgusLOG
ElseIf strBit = "64" Then
'This is 64 bit (no SP level check)
'Install pre-req if it's not already there
If Not IsThisHotfixInstalled(strPREFixID4) Then strCommandLinePRE = Chr(34) & strBasePath & strXP2K364PRE & Chr(34) & " " & strArgusEXE
strCommandLineCSE = Chr(34) & strBasePath & strXP2K364CSE & Chr(34) & " " & strArgusEXE
End If
Else
'It's some other OS, let's beat it...
Wscript.Quit()
End If

'Install GPP CSE Pre-req if strCommandLinePRE is defined
If strCommandLinePRE <> "" Then
ExecuteThis(strCommandLinePRE)
End If

'Install GPP CSE if strCommandLineCSE is defined
If strCommandLineCSE <> "" Then
ExecuteThis(strCommandLineCSE)
End If

Function ExecuteThis(FULLSTRING)
Dim objShell : Set objShell = CreateObject("Wscript.Shell")
ExecuteThis = objShell.Run(FULLSTRING,,1)
Set objShell = Nothing
End Function

Function IsThisHotfixInstalled(KBNUMBER)
Dim objWMI : Set objWMI = GetObject("winmgmts:\\.\root\CIMV2")
Dim colItm : Set colItm = objWMI.ExecQuery("SELECT * FROM Win32_OperatingSystemQFE")
IsThisHotfixInstalled = False
Dim objItm
For Each objItm In colItm
If Instr(objItm.Dependent,KBNUMBER) Then
IsThisHotfixInstalled = True
Exit For
End If
Next
Set colItm = Nothing
Set objWMI = Nothing
End Function




© OSzone.net 2001-2012