locked
Cannot delete WSUS role on SBS 2008 RRS feed

  • Question

  • Trying to fix WSUS on SBS 2008 server, I followed https://technet.microsoft.com/en-us/library/dd939818(v=ws.10).aspx and ran the command msiexec /x {BDD79957-5801-4A2D-B09E-852E7FA64D01} callerid=ocsetup.exe

    I'm still receiving error 0x80070643 with MessageCode: -2147023293 when trying to delete WSUS role from SBS 2008 server.

    The worst, I lost access to SharePoint Services.

    Any idea how could I get back Windows Internal Database, or fix suppression of WSUS role from SBS 2008 in order to reinstall after the role?

    Thank you

    Thursday, August 11, 2016 1:26 PM

Answers

  • Thank you Anne,

    I finally arrived to delete enterely WSUS with the help of a powershell script submitted by Microsoft Support.

    Thank you !

    Here is the powershell taht fixed the problem.

    Write-Host "****** WSUS 3.0 Removal Script - Ver 2.0 Author: moloyt@microsoft.com ******" -ForegroundColor Red -BackgroundColor Yellow
    Write-Host "****** This script will remove WSUS 3.0 from SBS 2008 ******" -ForegroundColor Red -BackgroundColor Yellow
    Write-Host "****** Please make sure you have a backup of the server before you proceed any further ******" -ForegroundColor Red -BackgroundColor Yellow
    
    
    $UserInput = Read-Host "Do you want to continue?" `n"[Y] Yes [N] No"
    if ($UserInput -eq "N") {Write-Host "Script execution cancelled" -ForegroundColor Red -BackgroundColor Yellow} 
    
    elseif ($UserInput -eq "Y") {
    
    #Creating backup folder
    Write-Host "Creating backup folder" -ForegroundColor Red -BackgroundColor Yellow
    MD $env:systemdrive\UpdateServicesBackup\RegistryBackup -Force -Confirm:$False
    
    
    #Stopping the Update Services service
    Write-Host "Stopping the Update Services service" -ForegroundColor Red -BackgroundColor Yellow
    Stop-Service WsusService -Force -Confirm:$False
    
    
    #Stopping the Windows Internal Database service
    Write-Host "Stopping the Windows Internal Database service" -Foreground Red -BackgroundColor Yellow
    Stop-Service *MICROSOFT##SSEE* -Force -Confirm:$False
    
    
    #Backing up the registry
    Write-Host "Backing up the registry" -ForegroundColor Red -BackgroundColor Yellow
    REG Export HKLM\System\CurrentControlSet\Services $env:systemdrive\UpdateServicesBackup\RegistryBackup\ServicesBackup.reg /y
    REG Export HKLM\Software\Microsoft\"Microsoft SQL Server" $env:systemdrive\UpdateServicesBackup\RegistryBackup\SQLBackup.reg /y
    if (Test-Path HKLM:\Software\Microsoft\"Update Services") {REG Export HKLM\Software\Microsoft\"Update Services" $env:systemdrive\UpdateServicesBackup\RegistryBackup\UpdateServicesBackup.reg /y}
    REG Export HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UserData $env:systemdrive\UpdateServicesBackup\RegistryBackup\UserDataBackup.reg /y
    REG Export HKLM\Software\Classes\Installer\Products $env:systemdrive\UpdateServicesBackup\RegistryBackup\ProductsBackup.reg /y
    
    
    #Storing information about the WSUS ContentDir in the variable
    if (Test-Path "HKLM:\Software\Microsoft\Update Services\Server\Setup") {$WSUSDbPath = Get-ItemProperty -Path "HKLM:\Software\Microsoft\Update Services\Server\Setup" -Name ContentDir}
    
    
    #Deleting WSUS Web Site and Application Pool
    Write-Host "Deleting WSUS Web Site and Application Pool" -ForegroundColor Red -BackgroundColor Yellow
    CD $env:windir\system32\inetsrv
    .\appcmd.exe add backup "IIS Backup before WSUS Removal"
    .\appcmd.exe stop apppool "DefaultAppPool"
    .\appcmd.exe stop site "Default Web Site"
    .\appcmd.exe delete site "WSUS Administration"
    .\appcmd.exe delete apppool "WSUSPool"
    
    
    #Deleting registry entries related to WSUS
    Write-Host "Deleting registry entries related to WSUS" -ForegroundColor Red -BackgroundColor Yellow
    New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
    if (Test-Path HKLM:\Software\Microsoft\"Update Services") {Remove-Item HKLM:\Software\Microsoft\"Update Services" -Force -Recurse -Confirm:$False}
    if (Test-Path HKLM:\System\CurrentControlSet\Services\WSUS*) {Remove-Item HKLM:\System\CurrentControlSet\Services\WSUS* -Force -Recurse -Confirm:$False}
    if (Test-Path HKLM:\Software\Classes\Installer\Products\25B648779C414CF4EB36EF60FA054124) {Remove-Item HKLM:\Software\Classes\Installer\Products\25B648779C414CF4EB36EF60FA054124 -Force -Recurse -Confirm:$False}
    if (Test-Path HKLM:\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\25B648779C414CF4EB36EF60FA054124) {Remove-Item HKLM:\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\25B648779C414CF4EB36EF60FA054124 -Force -Recurse -Confirm:$False}
    if (Test-Path HKCR:\WSUS*) {Remove-Item HKCR:\WSUS* -Force -Recurse -Confirm:$False}
    if (Test-Path HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\"Windows Server Update Services 3.0 SP2") {Remove-Item HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\"Windows Server Update Services 3.0 SP2" -Force -Recurse -Confirm:$False}
    if (Test-Path HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\"Windows Server Update Services 3.0 SP1") {Remove-Item HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\"Windows Server Update Services 3.0 SP1" -Force -Recurse -Confirm:$False}
    if (Test-Path HKLM:\Software\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx\"Update Services Assemblies") {Remove-Item HKLM:\Software\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx\"Update Services Assemblies" -Force -Recurse -Confirm:$False}
    
    
    #Renaming the C:\Program Files\Update Services folder
    Write-Host "Renaming the C:\Program Files\Update Services folder" -ForegroundColor Red -BackgroundColor Yellow
    CD $env:systemdrive
    if (Test-Path $env\"Program Files\Update Services") {Rename-Item -Path $env\"Program Files\Update Services" -NewName "Update Services_Old" -Force -Confirm:$False}
    if (Test-Path $env\"inetpub\wwwroot\iuident.cab") {Remove-Item -Path $env\"inetpub\wwwroot\iuident.cab" -Force -Recurse -Confirm:$False}
    if (Test-Path $env\"inetpub\wwwroot\WUTRACK.BIN") {Remove-Item -Path $env\"inetpub\wwwroot\WUTRACK.BIN" -Force -Recurse -Confirm:$False}
    if (Test-Path $env\"ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools\Windows Server Update Services.lnk") {Remove-Item -Path $env\"ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools\Windows Server Update Services.lnk" -Force -Recurse -Confirm:$False}
    if (Test-Path $env\"ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools\Microsoft Windows Server Update Services 3.0 SP1.lnk") {Remove-Item -Path $env\"ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools\Microsoft Windows Server Update Services 3.0 SP1.lnk" -Force -Recurse -Confirm:$False}
    if (Test-Path $env\"ProgramData\Microsoft\Event Viewer\Views\ServerRoles\WindowsServerUpdateServices.Events.xml") {Remove-Item -Path $env\"ProgramData\Microsoft\Event Viewer\Views\ServerRoles\WindowsServerUpdateServices.Events.xml" -Force -Recurse -Confirm:$False}
    
    
    #Renaming the WSUS folder
    Write-Host "Renaming the WSUS folder" -ForegroundColor Red -BackgroundColor Yellow
    if (Test-Path $WSUSDbPath.ContentDir) {Rename-Item -Path $WSUSDbPath.ContentDir -NewName "WSUS_Old" -Force -Confirm:$False}
    Get-PSDrive -PSProvider FileSystem | ForEach-Object {if(Test-Path (($_.root)+"WSUS")){Rename-Item -Path (($_.root)+"WSUS") -NewName (($_.root)+"WSUS_Old") -Force -Confirm:$False}}
    
    
    #Starting the Default Web Site and DefaultAppPool
    Write-Host "Starting the Default Web Site and DefaultAppPool" -ForegroundColor Red -BackgroundColor Yellow
    CD $env:windir\system32\inetsrv
    .\appcmd.exe start apppool "DefaultAppPool"
    .\appcmd.exe start site "Default Web Site"
    
    
    #Starting the Windows Internal Database service
    Write-Host "Starting the Windows Internal Database service" -Foreground Red -BackgroundColor Yellow
    Start-Service *MICROSOFT##SSEE* -Confirm:$False
    
    
    Write-Host "****** End of Script ******" -ForegroundColor Red -BackgroundColor Yellow
    Write-Host "****** You must reboot your server before attempting the installation of WSUS 3.0 ******" -ForegroundColor Red -BackgroundColor Yellow
    
    }
    
    else {Write-Host "Wrong input. Please type either Y or N" -ForegroundColor Red -BackgroundColor Yellow}
    


    Tuesday, August 16, 2016 6:23 PM

All replies

  • Hi Omar Seri,

    Check if the method descripts in the following blog could help to uninstall the WSUS role:

    Reinstall WSUS on SBS:

    https://glennopedia.com/2016/02/25/wsus-and-sbs/

    WSUS uninstall is failing:

    https://glennopedia.com/2016/02/25/wsus-uninstall-is-failing/

    (Note: the links below is from third-party web site, it may change the content without notification, we do not guarantee its safety.)

    Best Regards,

    Anne


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.


    Friday, August 12, 2016 2:24 AM
  • Hi Omar Seri,

    Just to confirm if you get any progress with the issue, if you need further help, feel free to feed back.

    Best Regards,

    Anne


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Tuesday, August 16, 2016 5:53 AM
  • Thank you Anne,

    I finally arrived to delete enterely WSUS with the help of a powershell script submitted by Microsoft Support.

    Thank you !

    Here is the powershell taht fixed the problem.

    Write-Host "****** WSUS 3.0 Removal Script - Ver 2.0 Author: moloyt@microsoft.com ******" -ForegroundColor Red -BackgroundColor Yellow
    Write-Host "****** This script will remove WSUS 3.0 from SBS 2008 ******" -ForegroundColor Red -BackgroundColor Yellow
    Write-Host "****** Please make sure you have a backup of the server before you proceed any further ******" -ForegroundColor Red -BackgroundColor Yellow
    
    
    $UserInput = Read-Host "Do you want to continue?" `n"[Y] Yes [N] No"
    if ($UserInput -eq "N") {Write-Host "Script execution cancelled" -ForegroundColor Red -BackgroundColor Yellow} 
    
    elseif ($UserInput -eq "Y") {
    
    #Creating backup folder
    Write-Host "Creating backup folder" -ForegroundColor Red -BackgroundColor Yellow
    MD $env:systemdrive\UpdateServicesBackup\RegistryBackup -Force -Confirm:$False
    
    
    #Stopping the Update Services service
    Write-Host "Stopping the Update Services service" -ForegroundColor Red -BackgroundColor Yellow
    Stop-Service WsusService -Force -Confirm:$False
    
    
    #Stopping the Windows Internal Database service
    Write-Host "Stopping the Windows Internal Database service" -Foreground Red -BackgroundColor Yellow
    Stop-Service *MICROSOFT##SSEE* -Force -Confirm:$False
    
    
    #Backing up the registry
    Write-Host "Backing up the registry" -ForegroundColor Red -BackgroundColor Yellow
    REG Export HKLM\System\CurrentControlSet\Services $env:systemdrive\UpdateServicesBackup\RegistryBackup\ServicesBackup.reg /y
    REG Export HKLM\Software\Microsoft\"Microsoft SQL Server" $env:systemdrive\UpdateServicesBackup\RegistryBackup\SQLBackup.reg /y
    if (Test-Path HKLM:\Software\Microsoft\"Update Services") {REG Export HKLM\Software\Microsoft\"Update Services" $env:systemdrive\UpdateServicesBackup\RegistryBackup\UpdateServicesBackup.reg /y}
    REG Export HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UserData $env:systemdrive\UpdateServicesBackup\RegistryBackup\UserDataBackup.reg /y
    REG Export HKLM\Software\Classes\Installer\Products $env:systemdrive\UpdateServicesBackup\RegistryBackup\ProductsBackup.reg /y
    
    
    #Storing information about the WSUS ContentDir in the variable
    if (Test-Path "HKLM:\Software\Microsoft\Update Services\Server\Setup") {$WSUSDbPath = Get-ItemProperty -Path "HKLM:\Software\Microsoft\Update Services\Server\Setup" -Name ContentDir}
    
    
    #Deleting WSUS Web Site and Application Pool
    Write-Host "Deleting WSUS Web Site and Application Pool" -ForegroundColor Red -BackgroundColor Yellow
    CD $env:windir\system32\inetsrv
    .\appcmd.exe add backup "IIS Backup before WSUS Removal"
    .\appcmd.exe stop apppool "DefaultAppPool"
    .\appcmd.exe stop site "Default Web Site"
    .\appcmd.exe delete site "WSUS Administration"
    .\appcmd.exe delete apppool "WSUSPool"
    
    
    #Deleting registry entries related to WSUS
    Write-Host "Deleting registry entries related to WSUS" -ForegroundColor Red -BackgroundColor Yellow
    New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
    if (Test-Path HKLM:\Software\Microsoft\"Update Services") {Remove-Item HKLM:\Software\Microsoft\"Update Services" -Force -Recurse -Confirm:$False}
    if (Test-Path HKLM:\System\CurrentControlSet\Services\WSUS*) {Remove-Item HKLM:\System\CurrentControlSet\Services\WSUS* -Force -Recurse -Confirm:$False}
    if (Test-Path HKLM:\Software\Classes\Installer\Products\25B648779C414CF4EB36EF60FA054124) {Remove-Item HKLM:\Software\Classes\Installer\Products\25B648779C414CF4EB36EF60FA054124 -Force -Recurse -Confirm:$False}
    if (Test-Path HKLM:\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\25B648779C414CF4EB36EF60FA054124) {Remove-Item HKLM:\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\25B648779C414CF4EB36EF60FA054124 -Force -Recurse -Confirm:$False}
    if (Test-Path HKCR:\WSUS*) {Remove-Item HKCR:\WSUS* -Force -Recurse -Confirm:$False}
    if (Test-Path HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\"Windows Server Update Services 3.0 SP2") {Remove-Item HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\"Windows Server Update Services 3.0 SP2" -Force -Recurse -Confirm:$False}
    if (Test-Path HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\"Windows Server Update Services 3.0 SP1") {Remove-Item HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\"Windows Server Update Services 3.0 SP1" -Force -Recurse -Confirm:$False}
    if (Test-Path HKLM:\Software\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx\"Update Services Assemblies") {Remove-Item HKLM:\Software\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx\"Update Services Assemblies" -Force -Recurse -Confirm:$False}
    
    
    #Renaming the C:\Program Files\Update Services folder
    Write-Host "Renaming the C:\Program Files\Update Services folder" -ForegroundColor Red -BackgroundColor Yellow
    CD $env:systemdrive
    if (Test-Path $env\"Program Files\Update Services") {Rename-Item -Path $env\"Program Files\Update Services" -NewName "Update Services_Old" -Force -Confirm:$False}
    if (Test-Path $env\"inetpub\wwwroot\iuident.cab") {Remove-Item -Path $env\"inetpub\wwwroot\iuident.cab" -Force -Recurse -Confirm:$False}
    if (Test-Path $env\"inetpub\wwwroot\WUTRACK.BIN") {Remove-Item -Path $env\"inetpub\wwwroot\WUTRACK.BIN" -Force -Recurse -Confirm:$False}
    if (Test-Path $env\"ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools\Windows Server Update Services.lnk") {Remove-Item -Path $env\"ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools\Windows Server Update Services.lnk" -Force -Recurse -Confirm:$False}
    if (Test-Path $env\"ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools\Microsoft Windows Server Update Services 3.0 SP1.lnk") {Remove-Item -Path $env\"ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools\Microsoft Windows Server Update Services 3.0 SP1.lnk" -Force -Recurse -Confirm:$False}
    if (Test-Path $env\"ProgramData\Microsoft\Event Viewer\Views\ServerRoles\WindowsServerUpdateServices.Events.xml") {Remove-Item -Path $env\"ProgramData\Microsoft\Event Viewer\Views\ServerRoles\WindowsServerUpdateServices.Events.xml" -Force -Recurse -Confirm:$False}
    
    
    #Renaming the WSUS folder
    Write-Host "Renaming the WSUS folder" -ForegroundColor Red -BackgroundColor Yellow
    if (Test-Path $WSUSDbPath.ContentDir) {Rename-Item -Path $WSUSDbPath.ContentDir -NewName "WSUS_Old" -Force -Confirm:$False}
    Get-PSDrive -PSProvider FileSystem | ForEach-Object {if(Test-Path (($_.root)+"WSUS")){Rename-Item -Path (($_.root)+"WSUS") -NewName (($_.root)+"WSUS_Old") -Force -Confirm:$False}}
    
    
    #Starting the Default Web Site and DefaultAppPool
    Write-Host "Starting the Default Web Site and DefaultAppPool" -ForegroundColor Red -BackgroundColor Yellow
    CD $env:windir\system32\inetsrv
    .\appcmd.exe start apppool "DefaultAppPool"
    .\appcmd.exe start site "Default Web Site"
    
    
    #Starting the Windows Internal Database service
    Write-Host "Starting the Windows Internal Database service" -Foreground Red -BackgroundColor Yellow
    Start-Service *MICROSOFT##SSEE* -Confirm:$False
    
    
    Write-Host "****** End of Script ******" -ForegroundColor Red -BackgroundColor Yellow
    Write-Host "****** You must reboot your server before attempting the installation of WSUS 3.0 ******" -ForegroundColor Red -BackgroundColor Yellow
    
    }
    
    else {Write-Host "Wrong input. Please type either Y or N" -ForegroundColor Red -BackgroundColor Yellow}
    


    Tuesday, August 16, 2016 6:23 PM
  • Hi Omar Seri,

    Glad to hear you have solved the issue. It'll be high appreciated if you share the powershell script with us :)

    You may also mark that as answer to this post, so that others meet the similar issue can find the resolution.

    Best Regards,

    Anne


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Wednesday, August 17, 2016 1:36 AM