Did the process actually do any work tonight?

Did the process actually do any work tonight?

Postby Metanis » 06.03.2018, 18:29

I removed my server 2012 implementation of WSUS because it was increasingly difficult to maintain. However, one of it's nice features was a daily email indicating the status of the nightly update process. I could see at a glance if there were any new updates downloaded or needing approval.

I planned on scripting a nightly run of WSUSOffline. However, I find it difficult to enunciate or enumerate if any updates actually were required during a WSUSOffline run. That is because it appears to go through the process of verifying every update even if the wsusscn2.cab file hasn't changed since the last run. And if you don't delete the log file between every attempt it grows large and unwieldy.

So my first question -- Is there some way short of studying the log file each and every time to determine if there were any updates that were new or corrupt and truly needed to be downloaded?

And my second question -- Would it be possible to simply abort the process (via option switch or programmatically) if wsusscn2.cab is not newer than the last 2 runs? (Assuming 1 run could have been interrupted.) In this case the log would be very short and easy to determine that nothing transpired.

Finally, my third question -- Is there a way to generate a unique log file for every attempted run of the program rather than appending to the existing file?

I have spent an hour today searching the forums for this information, forgive me if it is a newbie question.

-Mike T.
Posts: 1
Joined: 06.03.2018, 17:32

Re: Did the process actually do any work tonight?

Postby aker » 06.03.2018, 20:16

The easiest way would be checking the errorlevel / return value of DoUpdate.cmd. Errorlevel 0 means no update found or installation successfull. Errorlevel 3010 or 3011 mean reboot / recall required. If the script returns 0, you could check C:\Windows\wsusofflineupdate.log for lines containing "Installed ..\" using code similar to this
Code: Select all
type C:\Windows\wsusofflineupdate.log | find /i "Installed .." > %temp%\updates.log
Then (if not empty) mail this file to yourself.
Wer Rechtschreibfehler findet, darf sie behalten oder an den Meistbietenden versteigern. / Everybody finding a misspelling is allowed to sell it.
Posts: 2866
Joined: 02.03.2011, 15:32

Return to Installation / Updating

Who is online

Users browsing this forum: No registered users and 4 guests