There may be a situation where you wish to completely reinstall WSUS from scratch. This can occur for a number of reasons, but most commonly is due to database corruption, or performance issues due to a WSUS database that hasn’t been maintained properly with the normal maintenance.
Commonly, when regular maintenance hasn’t occurred on a WSUS database, when an admin finally performs it, it can take days and weeks to re-index the database, clean up the database, and run the cleanup wizards.
Also, due to timeouts on IIS, the cleanup wizard may fail which could ultimately cause database corruption.
Administrators often want or choose to blast away their WSUS install, and completely start from scratch. I’ve done this numerous times in my own environment as well as numerous customer environments.
In this guide, we are going to assume that you’re running WSUS on a Windows Server that is dedicated to WSUS and is using the WID (Windows Internal Database) which is essentially a built-in version of SQL Express.
PLEASE NOTE: If you are using Microsoft SQL, these instructions will not apply to you and will require modification. Only use these instructions if the above applies to you.
WSUS (Windows Server Update Services) relies on numerous Windows roles and features to function. As part of the instructions we’ll need to completely clear out:
Since we are completely removing IIS (Role, Configuration, and Folders/Files), only proceed if the server is dedicated to WSUS. If you are using IIS for anything else, this will completely clear the configuration and files. You also do not want to run this on a domain controller as Active Directory also uses WID.
Let’s get to it!
Remove-WindowsFeature -Name UpdateServices,UpdateServices-DB,UpdateServices-RSAT,UpdateServices-API
C:\WSUS C:\Program Files\Update Services
C:\inetpub C:\Windows\System32\inetsrv
C:\Windows\WID
sfc /scannow
WSUS, IIS, and WID have at this point been completely removed. We will now proceed to install, apply a memory fix, and configure WSUS.
For instructions on installing WSUS on Server Core, please click here: https://www.stephenwagner.com/2019/05/15/guide-using-installing-wsus-windows-server-core-2019/
Install-WindowsFeature UpdateServices -Restart
Install-WindowsFeature UpdateServices-RSAT, UpdateServices-UI
"C:\Program Files\Update Services\Tools\wsusutil.exe" postinstall CONTENT_DIR=C:\WSUS
And that’s it. You’ve completely reinstalled WSUS from scratch on your Windows Server.
While most of us frequently deploy new ESXi hosts, a question and task not oftenly discussed is how to properly decommission a VMware ESXi host. Some might be surprised to… Read More
This guide will outline the instructions to Disable the VMware Horizon Session Bar. These instructions can be used to disable the Horizon Session Bar (also known as the Horizon Client… Read More
Normally, any VMs that are NVIDIA vGPU enabled have to be manually migrated with manual vMotion if a host is placed in to maintenance mode, to evacuate the host. While… Read More
You may experience GPU issues with the VMware Horizon Indirect Display Driver in your environment when using 3rd party applications which incorrectly utilize the incorrect display adapter. This results with… Read More
Today we're going to cover a powerful little NAS being used with VMware; the Synology DS923+ VMware vSphere Use case and Configuration. This little (but powerful) NAS is perfect for… Read More
Today we'll go over how to install the vSphere vCenter Root Certificate on your client system. Certificates are designed to verify the identity of the systems, software, and/or resources we… Read More
View Comments
what a mess :(
Thanks you saved my day
Thank you, everything was on point
GAHHH...I've tried reinstalling WSUS three or four times and keep getting the same error - "one or several parent features are disabled so current feature can not be enabled"
I sought out someway to I've tried following these instructions twice and the powershell install command fails. DISMAPI_Error__Failed_To_Enable_Updates,Microsoft.Windows.ServerManager
Hi Jim,
Sounds like you might be having some issues with the OS itself that might be stopping this from working.
Are you running these commands as admin? Is the OS experiencing any other odd issues?
Cheers
I am a domain admin. It doesn't appear the OS is experiencing any other issues. I'm not sure what 'parent features' could be derailing it.
Also - side note - I removed IIS per your instructions but when I run the scm /scannow command it completes but didn't find any integrity violations so ....nothing was repaired?
Hi Jim,
The scan command should replace files that were deleted in previous steps. I've noticed sometimes that it doesn't report anything is missing.
That's odd about the parent features error. Are you copying and pasting the commands exactly as they are detailed in the post? Which command reports that issue?
Stephen
I'm redoing it now but I believe it was the first install command
Install-WindowsFeature UpdateServices -Restart
that generates the DISMAPI_Error__Failed_To_Enable_Updates,Microsoft.Windows.ServerManager
So if I use the regular server manager installer I get the parent message. When I use the Powershell command I get the DISMAPI error.
Here's the error I receive.
PS C:\Windows\system32> Install-WindowsFeature UpdateServices -Restart
Success Restart Needed Exit Code Feature Result
------- -------------- --------- --------------
False Maybe Failed {}
Install-WindowsFeature : Call was canceled by the message filter.
At line:1 char:1
+ Install-WindowsFeature UpdateServices -Restart
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : DeviceError: (Microsoft.Manag...rDetailsHandle):CimException) [Install-WindowsFeature],
Exception
+ FullyQualifiedErrorId : UnSupportedTargetDevice,Microsoft.Windows.ServerManager.Commands.AddWindowsFeatureComman
d
PS C:\Windows\system32>
I found this.
https://stackoverflow.com/questions/46729839/enable-feature-tcp-activation-on-windows-server-2016-fa...
It explains how to find what the disabled Parent feature could be but I don't know what -WindowsFeature component to test. I tried -Name Web-Server for IIS and UpdateServices but both DependsOn fields came up blank. What other features are installed with WSUS that I can try?
Jim,
I would recommend checking the event log and troubleshooting this. I have a feeling that your OS install has issues and it might be worth while correcting it before it turns in to something big in the future.
This has saved my skinny behind, phew!
Thank you Mr.Stephen Wagner, I try and success. You saved my time to reinstall from begin.
Thank you.
Hi Duong,
Glad to the post helped! :D
Stephen
I have other web services running on the same server, so I don't want to completely remove IIS if possible, any advice?
Because of our server restrictions, I had to run the "postinstall CONTENT_DIR=C:\WSUS" command as follows:
cd "C:\program files\update services\tools\"
then
.\wsusutil.exe postinstall content_dir=D:\wsus
(we use D: instead of C:)
For anyone who is getting the "Unexpected token 'postinstall' in expression or statement." error
This worked perfectly on windows 2019, had to run post installation task in Admin CMD.
Confused how this can work for anyone: the commands for reinstalling WSUS from PowerShell don't reinstall IIS after removing it on Server 2016. It's partly there (looks like 10 of 43 components installed according the info in the Add Server Roles window), but there is no IIS Management section to run the Memory Fix in step #5. In fact, there's no IIS anywhere in the Start menu.
Is there a missing step where we're supposed to use the Add Roles and Features Wizard or another PowerShell command to restore the other removed pieces of IIS? Do we need to do the install from the "Add Roles and Features Wizard" to ensure IIS installs properly?
Hi GraniteStateColin,
When you install WSUS, it will install the required IIS prerequisites.
If you're going to locally manage IIS, you'll need to install the feature/role for the IIS Management MMC.
To answer your other question, if you had any special IIS features installed that you need back, you'll need to manually install those using powershell or the "Add/Remove Features and Roles" as it won't reinstall any custom combinations of features or roles you may have had before.
Hope this helps!
Cheers,
Stephen
Stephen, thanks for the quick response. I'm not sure why, but when I followed the steps above, I do not get all of the needed IIS components installed. In the Add Roles and Features set, it shows 10 of 43 installed, so some pieces of IIS installed, but not the IIS Manager. On the other hand, when I use Add Roles & Features, to add WSUS per the standard new-install instructions, I get 11 out of 43 IIS components and the IIS Manager is included. 11 vs. 10.
If this doesn't sound right to you, maybe that's a sign that something is wrong with the server I'm trying to fix, but seems strange that 10 of the needed 11 IIS components did install, and that all install as expected if I use the GUI method.
Is there any downside in your experience to installing from Add Roles & Features in place of re-install steps 1 - 3?
Hi GraniteStateColin,
No worries. Sorry I'm a bit more delayed today.
When you say that you didn't get all the needed IIS components, are you referring to what's needed for WSUS, or what's needed for something else?
Using the commands in this post, will install what's needed for a basic install of WSUS using the command line to get up and running fast. When you re-install, you can also use the GUI as well if you'd like which may install more components. This is a bare install (which I do for security reasons).
As mentioned, if you want to run the IIS Manager locally, you'll need to add it using the Add Server Roles/Features wizard. The command in this post skips this as most people use RSAT from another system or server.
You can use the the command or the Add Roles and Features to install. The most important thing is uninstalling it properly to make sure no traces are left.
Cheers,
Stephen
Stephen, specifically, in your step #5 of the reinstall, where it refers to your other page to remove the memory limit for WSUS in IIS, at least for me, that's impossible following the PowerShell commands here. I was able to get that to work by instead using the Add Roles and Features Wizard and add WSUS that way instead. That added 1 more IIS module (11 out of 43 vs 10 out of 43 when using the PowerShell commands).
Everything seems to be working again for me, with that change to the instructions (reinstall using the GUI instead of the commands on this page so that it's possible to remove the memory limit via IIS). Your steps to ensure a full uninstall were profoundly helpful.
The command to install the IIS Manager varies, version to version, on Windows, so I didn't include it since it can be easily installable via the Add Features and Roles wizard.
I'm glad to hear you're up and running though! :)