Version 3.0 to 3.1 (Released 2017.09.16)
- Spelling error on DirtyDatabaseCheck in '.EXAMPLE'.
- Clarify using apostrophes in the AdamjMailReportSMTPServerPassword variable.
- Prerequisite update to might need to change the encoding to ANSI - now that I've removed any non-ASCII Character in the script.
- Corrected English on DeclineMultipleTypesOfUpdates if using -FirstRun so that it says 'today' rather than the scheduled streams number.
- Bug Fix: Change $AdamjWSUSServer to check to see if it's part of a domain, and if so, add the domain, otherwise use the hostname.
- Bug Fix: Revert Drivers SQL Removal back to 1.0 - 1.1 was causing errors killing the script from running.
Version 2.11 to 3.0 (Released 2017.09.01)
- NOTICE TO PREVIOUS USERS: Updated the description for RemoveDeclinedWSUSUpdates. Please read it.
- Added Test-IfBlocked - If it's blocked, it will unblock it.
- Changed the behaviour of -InstallTask to remove the ExecutionPolicy as it will be auto-unblocked.
- BUG FIX: Changed -InstallTask to work with 6.2 which is Server 2012.
- Added DirtyDatabaseCheck - Checks to see if your database is in a bad state. If it's in a bad state it fixes it.
- Changed WSUS Server variables to automatically pull from the registry entries. It should be fully automatic now for 99% of all cases.
- Added AdamjScriptVersion primarily for the -HelpMe stream for easier version recognition.
- Added DeclineMultipleTypesOfUpdates to replace DeclineSupersededUpdates.
- Changed -IncreaseApplicationPoolMemory to -SetApplicationPoolMemory and made it allow 0 (unlimited) or a higher number.
- Rewrote the prerequisites for SBS for clarity.
- Rewrote the .DESCRIPTION, organized the description of the streams by how they are run, with manual ones at the bottom.
- Rewrote the Install-Task function and added it to -FirstRun.
- Replaced some double quotes into single quotes around the script.
- Re-designed the SQL Testing and created it to auto-detect from the Windows Registry. It should be fully automatic now for 99% of all cases.
- Added a bypass for the -HelpMe stream if it can't connect to the WSUS Server, it will bypass and create the log file for help.
- Added WSUSIndexOptimization stream which will increase the speed of WSUS's database processing by 1000-1500 times faster.
- Added options for running RemoveWSUSDrivers in FirstRun and in the other routines.
- Clarified the Remote SQL Server instructions with the scheduled task running. Thank you to Ross Anderson for the full solution instructions.
- On Remote SQL Databases, setup the Scheduled Task to run as NT AUTHORITY\SYSTEM and add the DOMAIN\COMPUTER$ account to db_owner on only the SUSDB database.
- Added fix for spaces in the file or path name with regards to creating the scheduled task.
- Expanded the RemoveWSUSDriversSQL script to version 1.1 by adding new tables to check/resolve issues from.
- Ran some regular expression searches to remove any non-ASCII characters within the script and remove trailing tabs and spaces.
Version 2.10 to 2.11 (Released 2017.05.11)
- Re-organized Run switches.
- Added a Restart of the Application pool if you increase the application pool to make sure the settings take effect.
- Added logic to not connect to the WSUS server if not actually running something that requires it (Display & Increase the application pool and InstallTask).
- Added a configuration value for $AdamjScheduledTaskTime.
- Added a ComputerObjectCleanup Stream for more control over computer object removals.
- Cleaned up old commented code and spacing.
- Added and changed some commented code to verbose output.
Version 2.09 to 2.10 (Not Released)
- Added the Adamj Application Pool Memory Configuration Stream.
- Added information about Server 2016 at the prerequisites stage.
- Added Start-Transcript to -HelpMe stream as now everything is outputted to objects, not just Write-Host.
- Added Show-MyFunctions and Show-MyVariables and added them to the -HelpMe output instead of the contstraint to just Adamj Variables.
- Removed the Clean Up Variables section at the end. Once the script finishes running all variables within the script are destroyed as none are set globally.
- Changed $AdamjWSUSServer to auto-populate vs manual entry, along with changing it to lowercase within the script.
- Added comments for Gmail settings.
- Added comments in the SQL Server Variable section for the auto-detect issue on Server 2008 (R2).
- Added an SBS Section to the prerequisites.
- Created a function for Connect-WSUSServer.
- Created a function for -InstallTask and a check for powershell version 4 or higher within. Adjusted the Instructions at the top.
Version 2.08 to 2.09 (Not Released)
- Added CompressUpdateRevisions and RemoveObsoleteUpdates SQL Scripts as MonthlyRun items along with FirstRun.
- Added Configuration for Mail Report and Save Report options.
- Added Donation links.
- Fixed bug with running script from a folder with a space.
Version 2.07 to 2.08 (Not Released)
- Re-adjusted all Write-Host to Write-Output.
- Changed $AdamjScriptPath from split-path -parent $MyInvocation.MyCommand.Definition to Split-Path $script:MyInvocation.MyCommand.Path.
- Changed $VerbosePreference to "Continue" when executing -HelpMe.
- Added Begin, Process, End operators.
- Setup -HelpMe to change VerbosePreference to continue and change it back at the end to what it was before.
- Changed Test-Administrator to streamline the process.
- Changed SQL-Ping-Instance to Test-SQLConnection and cleaned up the code.
- Added some VERBOSE output throughout the script.
- Fixed a bug with $ExceptionError in the RemoveDeclinedWSUSUpdatesProceed function.
- Adjusted the prerequesites and added SQL Cmd line tools requirement with links.
- Fixed a bug with RemoveDeclinedWSUSUpdates, thanks to Nikolay Semov (Nikolay8159) from the Spiceworks forums.
- Added regions to each section for ease of modification and readability in PowerShell ISE and other editors.
Version 2.06 to 2.07
- Adjusted the prerequisites wording for clarity regarding the ANSI encoding.
Version 2.05 to 2.06
- Added notes regarding a Remote SQL connection such that you must use the computer account to run the script via Schedule Tasks.
- Added a -HelpMe Stream for getting troubleshooting data for support reasons.
- Check for for replica server and exclude only the DeclineSupersededUpdates as you can only decline superseded updates from the upstream server. Thanks to Jurriaan van Doornik for the help with testing and investigating.
- Adjusted the Timeout on the SQL-Ping Function to 60 seconds only if you specify the $AdamjSQLServer variable.
- Altered the Versioning notes layout for clarity and separation.
- Added a prerequisite of ANSI encoding for troubleshooting.
- Adjusted some of the descriptions of the streams information text to be more clear and consistent.
- Spelling and grammar fixes.
Version 2.04 to 2.05
- Tested on Server 2008 SP2, Server 2008 R2, Server 2012, and Server 2012 R2.
- Came up with installation instructions for prerequisites.
- Added code for detecting last day of the month if $AdamjScheduledRunStreamsDay is greater than the last day of the month, including leap years for months less than 31 days.
- Thank you to Malil for the initial base of the code for checking for $AdamjScheduledRunStreamsDay
Version 2.03 to 2.04
- Fixed issue with SQL Connection command for issues with connecting to a Windows Server 2008 Internal Database.
- Fixed some visual issues with the TXT output relating to the duration.
- Clarified some instructional text at the top.
Version 2.02 to 2.03
- Properly formatted running time duration to hh:mm:ss
- Added calculated duration of each stream, and total script duration.
- Removed a duplicated value in the setup configuration
Version 2.01 to 2.02
- Malil helped troubleshooting further and I made code changes for $AdamjSQLServer on Server 2008.
- Added better email logs for the RemoveWSUSDriversSQL Stream. Added console messages to show that the script is still working and what it is doing as this stream will take time. Added console error message summaries, and file/email error message details.
- Changed Quarterly months defaults to 1, 4, 7, 10.
Version 2.00 to 2.01
- Troubleshooting help by Malil from Spiceworks forums which lead to 2 small but significant code changes for the auto-detection of the $AdamjSQLServer variable, provided by Malil.
- Fixed the SCW to also account for hours run, rather than just minutes and seconds.
Version 1.5 to 2.01
- Changed the mail function to allow for authentication, SSL, and SMTP Port
- Cleaned up the 'Clean Up Variables' section to account for all Adamj* Variables
- Added Clean Up WSUS Synchronization Logs Stream to keep the Sync logs clean
- Added SQL Auto-detect with function help from (http://stackoverflow.com/questions/11540445/how-to-verify-whether-the-sql-server-instance-is-correct-or-not-using-powershell)
- Redesigned pretty much the entire script into a function driven script.
- Added cmdlet options for running each section manually, or by way of the recommended time periods (Daily, Monthly, Quarterly)
- Added error checking and throwing better error messages on various things.
- Added Test-Administrator to confirm it is being run with elevated rights.
- Updated the Prerequisites and Instructions sections.
- Updated the output of the SCW.
Version 1.3 to 1.5
- Added the Adamj Remove Drivers Stream, Adamj Remove Declined WSUS Updates Stream, and the Adamj WSUS DB Maintenance Stream. Renamed the Adamj Bonus Cleanup Stream to Adamj Decline Superseded Updates Stream.
- Changed the formulation of the script into modular form. Now the script has 5 modular streams:
- WSUS Server Cleanup Wizard Stream
- Adamj Remove WSUS Drivers Stream
- Adamj Remove Declined WSUS Updates Stream
- Adamj WSUS 3.0 DB Maintenance Stream
- Adamj Decline Superseded Updates Stream.
Version 1.2 to 1.3
- Added the $AdamjBonusCleanupUpdatesCount variable to the output line on the declining updates message, so that a copy/paste can easily be done that shows how many updates were declined when it actually declines them.
Version 1.1 to 1.2
- Created the Adamj Bonus Cleanup Stream. Changed the output email into HTML and formatted the output nicely.
- Thanks to Rob Dunn from the Spiceworks forums for reviewing the code and making some suggestions on the code to help enumerate information better.
Version 1.0 to 1.1