Jump to content

vicgarin

Member
  • Posts

    13
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Canada

Posts posted by vicgarin

  1. @vicgarin,

    I have tidied up this topic because I saw no reason to continue down the route I was taking you.

    I have had access to a Windows 7 Unit this evening and have therefore formulated something which should contain what you needed; (since systeminfo and quickfixengineering didn't include the .NET installs).

    @ECHO OFFSETLOCALSET _="%TEMP%\_$.TMP"TYPE NUL>%_%FOR /F "TOKENS=2 DELIMS==" %%A IN ('WMIC QFE GET HOTFIXID /VALUE 2^>NUL'	) DO CALL ECHO;[%%A]>>%_%FOR %%A IN (\ \WOW6432NODE\) DO (FOR /F "EOL=E TOKENS=*" %%B IN (		'REG QUERY HKLM\SOFTWARE%%AMICROSOFT\UPDATES /S /F "KB" /K 2^>NUL'		) DO FIND /I "[%%~nxB]"<%_%>NUL||ECHO;[%%~nxB]>>%_%)SORT<%_%>"%~dp0%COMPUTERNAME%HOTFIXES.TXT"DEL %_%

    Just run the above on each unit and compare the differences!

     

    I reran the above code, but it does not seem to list all the updates? For example MS Office updates?

     

     

    Also is it possible to also print out the title of the KB next to the KB number. This way I can exclude stuff like Windows Defender updates before comparing the 2 lists.

     

    Again thanks for helping.

  2. @vicgarin,

    I have tidied up this topic because I saw no reason to continue down the route I was taking you.

    I have had access to a Windows 7 Unit this evening and have therefore formulated something which should contain what you needed; (since systeminfo and quickfixengineering didn't include the .NET installs).

    @ECHO OFFSETLOCALSET _="%TEMP%\_$.TMP"TYPE NUL>%_%FOR /F "TOKENS=2 DELIMS==" %%A IN ('WMIC QFE GET HOTFIXID /VALUE 2^>NUL'	) DO CALL ECHO;[%%A]>>%_%FOR %%A IN (\ \WOW6432NODE\) DO (FOR /F "EOL=E TOKENS=*" %%B IN (		'REG QUERY HKLM\SOFTWARE%%AMICROSOFT\UPDATES /S /F "KB" /K 2^>NUL'		) DO FIND /I "[%%~nxB]"<%_%>NUL||ECHO;[%%~nxB]>>%_%)SORT<%_%>"%~dp0%COMPUTERNAME%HOTFIXES.TXT"DEL %_%

    Just run the above on each unit and compare the differences!

     

    Thank you. The above code does the trick!

     

    Edit: see below

  3.  

    You  can  also print out a .log file of all your .NET installs (Name and Version) from batch, just Run as administrator.

    ~DP

    @Echo Off::NetInstalls.cmd (Run As Admin)WMIC /NameSpace:\\Root\Cimv2 Path Win32_Product Where "Name Like '%%.NET%%'" Get Name, Version|Findstr /VI Version > C:\NetInstalls.logPause

     

    What I am trying to achieve is a listing of all the updates with the KB numbers, so I can compare 2 VMs. 

     

    That is which updates are missing in the offline VM, so I can download and install those manually.

  4.  

    Could you not have just copied and pasted the seven lines exactly as they are into notepad and saved as anything.cmd?

     

     

    When I saved it as .cmd file it works! It lists the .NET security updates KB numbers.

     

    Is it possible to filter out the lines which don't have any KB numbers associated with them? Because I am seeing stuff like:

     

    EMET 5.2

    Microsoft Office Shared Setup Metadata MUI (English) 2013

    ...

     

    Also is it possible to add all the installed updates into your script? Then I won't have to use the script mentioned in the original post.

     

    Thanks for your help.

  5.  

    Can you not get those using the software uninstall list?

    @ECHO OFFFOR %%A IN (\ \WOW6432NODE\) DO (FOR /F "TOKENS=1-2*" %%B IN (		'REG QUERY HKLM\SOFTWARE%%AMICROSOFT\WINDOWS\CURRENTVERSION\UNINSTALL^ /S /F "MICROSOFT CORPORATION" /D'	) DO IF %%D' EQU ' FOR /F "SKIP=1 TOKENS=2*" %%E IN (		'REG QUERY %%B /V DISPLAYNAME') DO ECHO;%%F)PAUSE

     

     

        Missing opening '(' after keyword 'for'.At line:1 char:5+ FOR  <<<< %%A IN (\ \WOW6432NODE\) DO (FOR /F "TOKENS=1-2*" %%B IN ('REG QUERY HKLM\SOFTWARE%%AMICROSOFT\WINDOWS\CURRENTVERSION\UNINSTALL^ /S /F "MICROSOFT CORPORATION" /D') DO IF %%D' EQU ' FOR /F "SKIP=1 TOKENS=2*" %%E IN ('REG QUERY%%B /V DISPLAYNAME') DO ECHO;%%F)    + CategoryInfo          : ParserError: (OpenParenToken:TokenId) [], ParentContainsErrorRecordException    + FullyQualifiedErrorId : MissingOpenParenthesisAfterKeywordPS C:\Windows\system32>
  6. I have been using this script http://tomtalks.uk/2013/09/list-all-microsoftwindows-updates-with-powershell-sorted-by-kbhotfixid-get-microsoftupdate

     $wu = new-object -com "Microsoft.Update.Searcher" $totalupdates = $wu.GetTotalHistoryCount() $all = $wu.QueryHistory(0,$totalupdates) # Define a new array to gather output $OutputCollection=  @() Foreach ($update in $all)    {    $string = $update.title     $Regex = "KB\d*"    $KB = $string | Select-String -Pattern $regex | Select-Object { $_.Matches }      $output = New-Object -TypeName PSobject     $output | add-member NoteProperty "HotFixID" -value $KB.' $_.Matches '.Value     $output | add-member NoteProperty "Title" -value $string     $OutputCollection += $output     }$OutputCollection | Export-Csv \\somedir\somefile.csv -NoTypeInformation -UseCulture

    but it does not list the .NET updates which I installed offline.

     

     

    In VM1 where I downloaded the same updates from Windows Update it lists them using the above script.

     

    But in VM2 where I installed them offline it doesn't list them?

     

    I used the above script because it also lists all the Office updates.

     

    Any help appreciated.

×
×
  • Create New...