Showing posts with label windows Auto Update. Show all posts
Showing posts with label windows Auto Update. Show all posts

Saturday, October 5, 2013

Getting Last Installation Success Date and Last Search Success date of Windows Updates using Powershell.

 

Everyday is a new day , with new problems and new issues, sometime at users side and sometime at Server side. The life in IT is quite happening.

These new issues and problems leads to new solutions and new scripts.

In my environment I asked few users to run their windows updates, but as you know user never listen ;o), So i thought to find out which users had install and run windows update and which is not.

The first thing which come in my mind is to check any com object available to windows update.

Luckily i found a “Microsoft.Update.AutoUpdate” com object and i thought lets give it a try.

I create a new Powershell Object using New-Object cmdlet.

$windowsUpdateObject = New-Object -ComObject Microsoft.Update.AutoUpdate

05-10-2013 00-22-27

My this new variable has a property of Results. So when I access the .Result property using dot notation, i have found the result what i was looking for,  The windows last Search success date and Windows update last installation date.

$windowsUpdateObject.Results

05-10-2013 00-58-11

 

$windowsUpdateObject.Results.LastInstallationSuccessDate

 

05-10-2013 00-27-33

 

$windowsUpdateObject.Results.LastSearchSuccessDate

 

05-10-2013 00-27-57

You can see the windows automatic basic setting using .Settings property.

$windowsUpdateObject.Settings

05-10-2013 01-03-07

The most cool thing which i have found is ShowSettingsDialog(), method. When you run this method it opens a Windows Update configuration GUI.

$windowsUpdateObject.ShowSettingsDialog()

05-10-2013 01-04-02

I hope you like it.

Thanks for your time and Happy Weekend.

Thanks

Aman Dhally

 

clip_image001 clip_image002 clip_image003 clip_image005  clip_image007