Wsus best practices


Published on

Published in: Technology
1 Comment
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Wsus best practices

  1. 1.
  2. 2. This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like.<br />For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site, <br />For links to newly-posted decks, follow us on Twitter:@concentrateddon or @concentratdgreg<br />This work is copyright ©Concentrated Technology, LLC<br />
  3. 3. Best Practices in Architecting& Implementing WSUS<br />Greg Shields<br />Partner & Principal Technologist<br />Concentrated<br />Session Code: WSV208<br />
  4. 4. Presentation Outline (hidden slide):<br />Speakers:complete this slide using the session information found at the speaker portal.<br />Title: Best Practices in Architecting and Implementing Windows Server Update Services<br />Technical Level: 200<br />Intended Audience: Technologists, Systems Administrators, WSUS Implementers<br />Objectives (what do you want the audience to take away from this session):<br />1. Bad WSUS architectures will equal poor update installation.<br />2. Using WSUS for servers is different than for workstations.<br />3. What are the real-world best practices for applying updates.<br />Presentation Outline (including demos):<br />
  5. 5. Agenda<br />Topics<br />Part I: Architecting & Implementing WSUS<br />Part II: Troubleshooting WSUS<br />Part III: Tips & Tricks for Using WSUS<br />5<br />
  6. 6. Architecting & Implementing WSUS<br />Part 1<br />
  7. 7. WSUS Product Vision<br />Simple, zero-cost solution for distributing Microsoft Updates content in a corporation.<br />A “free” RTW add-on for Windows Server<br />Solution only distributes Microsoft Updates <br />Distributing 3rd party patches require purchasing advanced management tools such as SCE or Configuration Manager 2007<br />Provides a foundation for Update Management across Microsoft products: SCE, Configuration Manager 2007, MBSA, WU, SBS, Forefront, …<br />Consistent scan results<br />Unified client scan mechanism (WUA) irrespective of which server actually manages the updates.<br />
  8. 8. WSUS Momentum<br />Over 500,000 distinct WSUS servers synched with Microsoft Update last month<br />Used by over 60% medium/large orgs and built into SBS<br />WSUS 3 released April 30 2007<br />Huge improvements in performance, deployment options, reporting and UI<br />Easy in-place upgrade from WSUS2<br />WSUS 3.0 SP1 released Feb 7, 2008<br />WSUS 3.0 SP2 released Jan 26, 2009<br />
  9. 9. WSUS Lifecycle/Roadmap<br />Support lifecycle<br />
  10. 10. WSUS 3.0 SP1/SP2 Adds Features<br />WSUS 3 SP1 added the following features:<br />Installs on Windows Server 2008, integrated with Server Manager (after installing Server Manager update KB940518)<br />API enhancements for advanced management tools<br />Bug fixes<br />WSUS 3 SP2 adds:<br />Installs on Windows Server 2008 R2<br />Supports managing Win7 clients<br />Support for BranchCache<br />Auto-approval rules with deadlines<br />Bug fixes (DSS gets languages from USS, target groups sorted alphabetically, more robust setup upgrade)<br />Compliance against approved updates<br />
  11. 11. New Features in WSUS SP2<br />Greg Shields<br />Partner & Principal Technologist<br />Concentrated Technology<br /><br />demo<br />
  12. 12. Elements of ArchitectureWhy Architecture?<br />Problems are usually results of improper architecture<br />A correct architecture will drive a better design<br />Especially in situations of administrator distrust or insufficient bandwidth<br />Design your WSUS solution with the same goals as your AD solution<br />Roaming users should be dealt with separately<br />12<br />
  13. 13. “Simple” Architecture<br />Single, well-connected site<br />WSUS Updates from MU<br />Clients update from WSUS<br />Single server can handle 25,000 clients<br />50K clients with 2x front-end servers and big SQL back-end<br />Remote SQL configuration reduces server load<br />Front-end handles update sync load<br />Back-end handles reporting load<br />13<br />
  14. 14. “Simple, with Groups” Architecture<br />14<br />Largest use case in production today<br />Driving forces to move to Machine Groups:<br />Differing patching requirements or schedules<br />Test groups<br />Servers vs. Workstations<br />Politics<br />Not necessarily used for load distribution<br />
  15. 15. WSUS Chaining<br />Chaining involves downstream servers getting updates (and sometimes Group data) from upstream servers<br />Options for chaining<br />Distributed vs. Centralized model<br />“Autonomous Mode” vs. “Replica Mode”<br />Chaining solves the problem of “mesh” or “fully independent” architectures<br />Wastes resources and bandwidth<br />Not that some situations don’t mandate “mesh” or “fully independent” architectures!<br />15<br />
  16. 16. “Centralized” Architecture<br />Downstream servers are replicas of primary server<br />Little downstream control over servers<br />Downstream admins drop machines into predefined groups<br />All update approvals and schedule done at primary server<br />16<br />
  17. 17. “Distributed” Architecture<br />Downstream servers obtain updates from primary server, except:<br />Update approvals do not flow down. Assigned at each site individually.<br />Downstream admins have greater control. Can create groups and assign approvals.<br />Used for distribution rather than control of updates<br />17<br />Combinations of centralized anddistributed possible. Depends onintra-IT trust model.<br />
  18. 18. “Disconnected” Architecture<br />Many environments don’t have Internet connectivity.<br />Test/dev, government, classified, air gap environments<br />Data must be imported from “the outside”<br />Any the previous architectures will work<br />Manual import process required<br />Gives CM/QA/Security the option to review updates prior to bringing “inside”.<br />18<br />Sneakernet<br />
  19. 19. “Disconnected” Architecture<br />Match advanced options between source and target.<br />Express installation files & languages must match.<br />Backup & restore updates from source to target.<br />Back up C:WSUSWSUSContent<br />Restore to the same location on the target server.<br />Transfer update metadata from source to target.<br />Navigate to C:Program FilesUpdate ServicesTools<br />Export metadata using wsusutil.exe export {packageName} {logFile}<br />Import with wsusutil.exe import {packageName} {logFile}<br />packageName & logFileare unique names you choose<br />19<br />Database validation can take multiple hours to complete!<br />
  20. 20. “Roaming” Architecture<br />Manages updates for external resources<br />WSUS servers distribute approval metadata<br />Clients download updates from Windows Update directly.<br />Extra security for internet-facing WSUS server<br />Useful separate architecture for mostly off-net clients<br />20<br />Laptop WSUS<br />Laptops<br />
  21. 21. “Roaming” Architecture<br />Four Steps to Internet-facing WSUS<br />Build server in DMZ and position behind ISA proxy<br />Locate database on server not reachable from Internet<br />Enable SSL for communications<br />Host content on Microsoft Update<br />21<br />Laptop WSUS<br />Laptops<br />
  22. 22. “High Availability” Architecture<br />WSUS 3.0 includes native support for high availability<br />NLB Clusters connect multiple WSUS web servers via a single cluster IP<br />SQL Cluster manages the database<br />No single point of failure<br />Critical: This design isuseful for availability,but does little forperformance.<br />22<br />
  23. 23. Managing Branch Offices<br />Branch offices are typically managed through replica WSUS servers<br />Replica servers take all orders from the central server.<br />Settings at the top flow downward, but take time.<br />Alternatively, unify architecture through a single “central server”<br />Single server manages all clients across all offices<br />Deploy ISA proxy in the branch<br />Enable BITS peer-caching<br />Use delta files to reduce network traffic.<br />10x more server disk space<br />4x less client download <br />23<br />
  24. 24. Upgrade deployment<br />WSUS 3 SP1 setup supports in-place upgrade<br />One-way upgrade (no rollback)<br />Can’t be done from WSUS 2 on Windows Server 2000 or using SQL 2000<br />Alternative is migration upgrade:<br />Install second server<br />If original server is WSUS2 SP1:<br />Perform disconnected replica steps (wsusutil, ntbackup, wsusmigrate)<br />Switch over client via policy<br />If original server is also WSUS3<br />Configure new server to be a replica of the first and sync<br />After sync, configure new server to be autonomous<br />Upgrade hierarchy from top down<br />
  25. 25. Troubleshooting WSUS<br />part 2<br />
  26. 26. Errors and Error Codes<br />Numerous WSUS error codes exist.<br />A complete list of all WSUS error codes is available on-line at windows_update_codes.htm<br />For example, 0x8DDD0018 occurs when one of these services is Disabled<br />Automatic Updates<br />BITS<br />Event Log<br />26<br />
  27. 27. Errors and Error Codes II<br />0x80072EE2, 0x80072EFD<br />This issue occurs because the Windows Update client did not receive a timely response from the Windows Update Web site server. <br />Likely a proxy configuration, personal firewall, or trusted hosts problem<br />27<br />
  28. 28. Errors and Error Codes III<br />0x80246008, 0x8024402C<br />Caused by BITS malfunctioning or corrupted.<br />Download and extract the BITSAdmin tool from the Windows Support Tools CD.<br />Bitsadmin /util /repairservice /force<br />If that doesn’t work, try a BITS re-install<br />Though if you do a BITS re-install, clear out the %SystemRoot%SoftwareDistribution folder and reboot when done.<br />Its worth mentioning here that thereis no “backup” download process for WUA.<br />…like HTTP or FTP…If BITS is non-functional, so is patching!<br />28<br />
  29. 29. Errors and Error Codes IV<br />0x80244019<br />This error is often caused when the Proxy server is not properly configured.<br />Ensure that your Proxy server allows Anonymous access to these external addresses:<br /> <br />http://* <br />https://* <br />http://* <br />https://* <br />http://* <br /><br /> <br />http://* <br /> <br /><br />Microsoft doesnot publish the IP’sassociated with theseFQDN’s.So, if you do perimeternetwork security by IPyou’ve gotta’ stayon the ball with these!<br />29<br />
  30. 30. WUA Client Issues<br />To enable auto-updates, ensure:<br />Anonymous access granted to Self Update virtual directory on WSUS server<br />Auto-updates requires TCP/80 to function on WSUS server<br />Be aware of GP replication times<br />90 to 120 minute GP refresh timing will impact speed of clients becoming visible in WSUS admin tool<br />Be aware of AU detection frequency times<br />WUA client set to check with server every 22 hours (minus offset).<br />When WUA checks in is when it checks WUA version.<br />Need to do wuauclt /detectnow to force this to occur on-demand.<br />30<br />
  31. 31. WUA Client Issues II<br />Known issue with imaged workstations:<br />If you image your workstations (and who doesn’t these days!), you must change SID<br />Sysinternals NewSID, Microsoft SysPrep<br />Not doing this will prevent WUA from contacting WSUS<br />To fix this problem:<br />Run one of the above tools to change the SID<br />HKLMSoftwareMicrosoftWindows CurrentVersionWindowsUpdate<br />Delete PingID, SUSClientID, and AccountDomainSID values<br />Restart wususerv service<br />Run wuauclt /resetauthorization /detectnow<br />31<br />
  32. 32. WUA Client Issues III<br />Disabling the Automatic Updates Service or the BITS Service at any point in the past prevents it from starting properly when you need it!<br />Reset permissions on these services to re-enable functionality.<br />Use the Service Control Resource Kit tool (sc.exe) to do this:<br />sc sdset bits "D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)"<br />sc sdsetwuauserv "D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)“<br />Every disabled client needs this!<br />32<br />
  33. 33. Tips & Tricks for Using WSUS<br />part 3<br />
  34. 34. Optimize Patch Distribution<br />In large, multi-site environments low bandwidth may cause problems for remote offices.<br />Distributing updates to downstream servers is big problem<br />Potential solutions:<br />Ensure downloading only the languages you need<br />Configure patch distribution to occur in the evenings.<br />Stagger patch distributions between tiered sites<br />Express installation files can exacerbate this.<br />The bandwidth savings in express installation files occurs from WSUS server to client, not between WSUS servers.<br />Throttle BITS<br />34<br />
  35. 35. Throttling BITS<br />BITS can be throttled either on the WSUS server or additionally on all the clients.<br />Alleviates network saturation during update distribution and during client installation<br />Be aware that this does slow down update distributions!<br />Throttle BITS in Group Policy:<br />Computer Configuration | Administrative Templates | Network | Background Intelligent Transfer Service<br />Two settings:<br />Maximum network bandwidth that BITS uses<br />Limit by Kbps based on time of day or at all times<br />Be aware that Kbps is kiloBITS not kiloBYTES (divide by 8)<br />Timeout (in days) for inactive jobs<br />35<br />
  36. 36. DNS Netmask Ordering<br />Non-centralized architectures can better route clients through DNS Netmask ordering.<br />Microsoft DNS Round Robin will first provide an IP address in the same subnet as the requestor.<br />If no IP exists in the same subnet, a random IP will be selected.<br />All WSUS hosts must respond to the same FQDN.<br />DNS FQDN record is populated with IP addresses of all WSUS servers in the network.<br />36<br />
  37. 37. Server Tuning<br />Run cleanup and DB defrag every few months<br />Cleanup wizard is a feature in WSUS 3<br />Removes stale computers and updates<br />DB index defrag script available on ScriptCenter<br />keeps the server running fast<br />Look out:<br />Take care to not remove computers that are still active (but having trouble contacting the server)<br />Populate from AD sample tool can help<br />In a hierarchy, need to run cleanup on each WSUS server.<br />Clean computers from bottom-up<br />Clean updates from top-down (or between sync intervals)<br />Can be automated through the API<br />
  38. 38. 38<br />Considerations for Updating Servers<br />Servers require more care than workstations…<br />A rebuild is usually not an acceptable solution for a failed patch installation.<br />Outage windows are shorter.<br />But in some ways servers are easier…<br />Data and system drives usually separated.<br />Hardware configuration is usually more stable or well-understood.<br />Service isolation and redundancy – in larger environments – limits exposure/risk.<br />People typically aren’t “surfing” on servers.<br />The RAID 1 Undo Trick…<br />
  39. 39. What About Reboots?<br />I’ve said this before, and I’ll say it again:<br />“If you have a patch management plan without a reboot strategy, you don’t have a patch management plan.”<br />Three methods:<br />Client-initiated<br />WSUS-initiated<br />Script-initiated<br />Two methodologies:<br />Scheduled reboots vs. rebooting for patch installation<br />I will argue in favor of scheduled, forced rebootsover mid-day reboots.<br />39<br />
  40. 40. Handling Reboots<br />RebootFile = "computers.txt“<br />LogFile = "results.txt"<br />Set fso = CreateObject("Scripting.FileSystemObject")<br />Set f = fso.OpenTextFile(RebootFile, 1, True)<br />Set objTextFile = fso.OpenTextFile(LogFile, 2, True)<br />On Error resume next<br />Do While f.AtEndOfLine <> True<br />strComputer = f.ReadLine<br /> Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!" & strComputer & "rootcimv2")<br /> If Err.Number <> 0 Then<br />objTextFile.WriteLine(strComputer & " is not responding.")<br />Err.Clear<br /> Else<br /> Set colOperatingSystems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")<br />objTextFile.WriteLine(strComputer & " is rebooting.")<br /> For Each objOperatingSystem in colOperatingSystems<br />ObjOperatingSystem.Reboot()<br /> Next<br /> End If<br />Loop<br />
  41. 41. Custom Reports<br />UI supports basic customization (filters)<br />Advanced customization can be built on<br />WSUS (.Net) API<br />Can use of PowerShell scripts to generate reports<br />Public read-only SQL views<br />Can use SSRS to generate reports (if full SQL)<br />Samples available from MSDN<br />E.g., compliance against approved updates<br />
  42. 42. Match KBs to MSRCs<br />Ever wish you had a nice mapping of knowledgebase numbers to MSRC numbers?<br />“The Q-numbers to the MS-numbers”<br />This script outputs a .CSV file that provides just that mapping<br />Add the name of your WSUS server into the top line of the script: strWSUSServer = “<Enter WSUS Server here>"<br />42<br />
  43. 43. Match KBs to MSRCs<br />strWSUSServer = “<Enter WSUS Server here>"<br />Set fso = CreateObject("Scripting.FileSystemObject")<br />Set objTextFile = fso.OpenTextFile("OUTPUT.csv", 2, True)<br />objTextFile.WriteLine("MS Number,Q Number")<br />Set conn = CreateObject("ADODB.Connection")<br />Set rs = CreateObject("ADODB.Recordset")<br />dbconn = "Driver={SQL Server};Server=" & strWSUSServer & ";Database=SUSDB"<br />conn.opendbconn<br />strSQLQuery = "SELECT dbo.tbSecurityBulletinForRevision.SecurityBulletinID, dbo.tbLocalizedProperty.Title FROM dbo.tbLocalizedPropertyForRevision INNER JOIN dbo.tbLocalizedProperty ON dbo.tbLocalizedPropertyForRevision.LocalizedPropertyID = dbo.tbLocalizedProperty.LocalizedPropertyID INNER JOIN dbo.tbSecurityBulletinForRevision ON dbo.tbLocalizedPropertyForRevision.RevisionID = dbo.tbSecurityBulletinForRevision.RevisionID WHERE (dbo.tbLocalizedPropertyForRevision.LanguageID = 1033) ORDER BY dbo.tbSecurityBulletinForRevision.SecurityBulletinID"<br />rs.OpenstrSQLQuery, conn, 3, 3<br />While Not rs.EOF<br />objTextFile.WriteLine(rs.Fields(0).Value & "," & Replace(rs.Fields(1).Value, ",", ""))<br />rs.MoveNext<br />Wend<br />WScript.Echo "Done!"<br />
  44. 44. Agent Control<br />Use WUA API to control the agent<br />Custom install schedules<br />Updating servers in web farms<br />Implementing “install now” functionality<br />
  45. 45. On-Demand Patching(You Patch Now!)<br />Ever wish you had a WSUS “Big Red Button”?<br />Such a button might automatically download and install all approved patches and reboot if necessary…<br />How about this VBScript?<br />Run this script from any server console<br />Immediately downloads and installs all approved patches.<br />If a reboot is required, it will then reboot the server.<br />45<br />
  46. 46. The WSUS Big Red Button<br />Set fso = CreateObject("Scripting.FileSystemObject")<br />Set objAutomaticUpdates = CreateObject("Microsoft.Update.AutoUpdate")<br />objAutomaticUpdates.EnableService<br />objAutomaticUpdates.DetectNow<br />Set objSession = CreateObject("Microsoft.Update.Session")<br />Set objSearcher = objSession.CreateUpdateSearcher()<br />Set objResults = objSearcher.Search("IsInstalled=0 and Type='Software'")<br />Set colUpdates = objResults.Updates<br />Set objUpdatesToDownload = CreateObject("Microsoft.Update.UpdateColl")<br />intUpdateCount = 0<br />For i = 0 to colUpdates.Count - 1<br />intUpdateCount = intUpdateCount + 1<br /> Set objUpdate = colUpdates.Item(i)<br />objUpdatesToDownload.Add(objUpdate)<br />Next<br />‘<<This is only the first half of the script. Add the code from the next page to <br />‘create the full script>><br />
  47. 47. The WSUS Big Red Button<br />‘<<Add this half to the code on the previous page!>><br />If intUpdateCount = 0 Then<br />WScript.Quit<br />Else<br /> Set objDownloader = objSession.CreateUpdateDownloader()<br />objDownloader.Updates = objUpdatesToDownload<br />objDownloader.Download()<br /> Set objInstaller = objSession.CreateUpdateInstaller()<br />objInstaller.Updates = objUpdatesToDownload<br /> Set installationResult = objInstaller.Install()<br /> Set objSysInfo = CreateObject("Microsoft.Update.SystemInfo")<br /> If objSysInfo.RebootRequired Then<br /> Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}!localhostrootcimv2")<br /> Set colOperatingSystems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")<br /> For Each objOperatingSystem in colOperatingSystems<br />objOperatingSystem.Reboot()<br /> Next<br /> End If<br />End If<br />
  48. 48. Other API Uses<br />ISVs use APIs for many other features as well<br />Distribute 3rd party updates (quite complex)<br />Gather software and hardware inventory<br />Distribute updates to non-Windows devices<br />Your starting point is<br />API Samples<br />Diagnostic Tools<br />Header Files<br />
  49. 49. Summary<br />WSUS is simple to use, but scales to enterprise<br />Flexible server deployment options<br />Single server, scale up, branch office, scale out, disconnected, roaming laptops<br />Flexible update deployment options<br />Peer caching, delta patching, auto approval rules, auto-reapprove revisions<br />Periodically tune the server (defrag + cleanup)<br />Public API and DB views can be used to extend the base functionality for many advanced scenarios<br />Starting point for all WSUS information<br /><br />
  50. 50. question & answer<br />
  51. 51. Required Slide<br />Speakers, <br />TechEd 2009 is not producing <br />a DVD. Please announce that <br />attendees can access session <br />recordings at TechEd Online. <br /><br />Sessions On-Demand & Community<br /><br />Microsoft Certification & Training Resources<br /><br />Resources for IT Professionals<br /><br />Resources for Developers<br /><br />Microsoft Certification and Training Resources<br />Resources<br />
  52. 52. Required Slide<br />Complete an evaluation on CommNet and enter to win!<br />
  53. 53. Required Slide<br />© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.<br />The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.<br />
  54. 54. This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like.<br />For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site, <br />For links to newly-posted decks, follow us on Twitter:@concentrateddon or @concentratdgreg<br />This work is copyright ©Concentrated Technology, LLC<br />