Detect Installed KB with Powershell & VBScript for SCCM 2012

get-hotfix | Where-Object {$_.HotFixID -match “KB2835517”}

wusa.exe “Windows6.3-KB2835517-x64.msu” /quiet /norestart /log:%WINDIR%\Temp\Install_SDC_Microsoft_MediaPack_1.0_01.00_ML.log

wusa.exe /uninstall “Windows6.3-KB2835517-x64.msu” /kb:KB2703761 /quiet /norestart /log:%WINDIR%\Temp\Uninstall_SDC_Microsoft_MediaPack_1.0_01.00_ML.log

_____________________________________________________________

<span class=”rem”>’Returns info if Windows Management Framework 3 in installed</span>

<span class=”rem”>’ ———————————————————-‘ </span>

<span class=”kwrd”>Option</span> Explicit

<span class=”kwrd”>Dim</span> objWMIService, strComputer

strComputer = <span class=”str”>&quot;.&quot;</span>

<span class=”rem”>’Run the query</span>

<span class=”kwrd”>Set</span> objWMIService = GetObject(<span class=”str”>&quot;winmgmts:&quot;</span> _

&amp; <span class=”str”>&quot;{impersonationLevel=impersonate}!\\&quot;</span> _

&amp; strComputer &amp; <span class=”str”>&quot;\root\cimv2&quot;</span>)

<span class=”kwrd”>Dim</span> QFEs

<span class=”kwrd”>Dim</span> QFE

<span class=”kwrd”>Set</span> QFEs = objWMIService.ExecQuery (<span class=”str”>&quot;Select * from win32_QuickFixEngineering where HotFixID like ‘KB2506143’&quot;</span>)

<span class=”kwrd”>For</span> <span class=”kwrd”>Each</span> QFE <span class=”kwrd”>in</span> QFEs

Wscript.echo <span class=”str”>&quot;Update KB2506143 was installed by &quot;</span> &amp; QFE.InstalledBy &amp; <span class=”str”>&quot; on &quot;</span> &amp; QFE.InstalledOn

<span class=”kwrd”>Next</span>

WScript.Quit


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *