mattcrum Posted June 1, 2012 Posted June 1, 2012 Any tips or suggestions on how to determine if a Windows update from WSUS has been completed via a VB script or something of the sort? I am running Windows 7 on the clients and 2008r2 for the WSUS. All of the clients have been frozen with Faronics Deep Freeze and I want to automate the process of updating, so I need to thaw the machine, make the updates, then freeze them (the clients) once the updates are finished. Right now I am using a VB script to automate the freezing and thawing and whatnot. Alternatively, if the WSUS could initiate a batch file or something once the upgrade is complete, that would work well. Any tips would be greatly appreciated! Thanks!
sted Posted June 1, 2012 Posted June 1, 2012 you could run wuauclt /detectnow on the pcs as a script should force them to check for updates
mattcrum Posted June 1, 2012 Author Posted June 1, 2012 Thanks! Yeah. I am already doing that to initiate the updates. I want to know when the updates on the client machine are completed so I can then call a script to freeze the machine... It seems there is an WSUS API available which I am taking a look at to see if there is something I can take advantage of.
Michael Posted June 2, 2012 Posted June 2, 2012 If you open up WSUS, all clients will report to the console. If it reads 100% then updating is complete.
mattcrum Posted June 4, 2012 Author Posted June 4, 2012 If you open up WSUS, all clients will report to the console. If it reads 100% then updating is complete. Thanks for the tip. I understand that. I want an application to be able to know when WSUS is complete so it can perform certain functions afterwards in an automated fashion without any user interaction. I think WSUS has an API but I may just be able to read from the log. I haven't done this before so I'm not sure if there is a "right" way to do this.
ADMaster Posted June 5, 2012 Posted June 5, 2012 I use a WSUS script from Rob Dunn that checks for installs then emails a report of updates installed. I am sure somewhere in that code are the functions you need. I think I found it in the spiceworks script center. Hope this gets you in the right direction. 1
psydii Posted June 6, 2012 Posted June 6, 2012 This may be of some use: Powershell 2.0 - get-hotfix cmdlet problem Basically, you can use powershell to detect Windows Componant updates (get-hotfix) or vb to qurey the underlying WMI object. For other updates you can query the installer registry keys. To quote Mervyn Zhang from the thread linked above (in case the link breaks at some point in the future): As a workaround, I suggest you try to query Registry. Windows Installer applications are listed in the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ For each product, there is a GUID corresponding registry key. To detect Office updates, you may consider querying the registry keys and retrieve the matching ones. A sample update: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{90120000-0017-0000-0000-0000000FF1CE}_SharePointDesigner_{1D53FB73-9826-4541-B2E0-A239C6EBA718} That said, I'd be tempted to install MSBA 2.2 and call that from the command line to confirm weather all authorised updates have installed on the local machine. 1
mattcrum Posted June 6, 2012 Author Posted June 6, 2012 Thanks so much psydii. Very helpful and seems this helps me get on the right track. If I have any issues I'll reply back. I'll try and remember to post my solution.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now