2015年4月24日 星期五

手動移除WSUS

手動移除WSUS

轉載至 http://masterman.pixnet.net/blog/post/28854318-%E3%80%90wsus%E3%80%91%E6%89%8B%E5%8B%95%E7%A7%BB%E9%99%A4wsus

NOTE: This article is out of date and no longer applies.  We are researching alternaitves and will post them here when available.
=====
Hey, let's face it, bad luck can strike the best of us, so if you find yourself in a position where your WSUS box is corrupt beyond repair, the regular uninstall isn't working and you have no choice but to do a complete removal and reinstallation then maybe these steps by Ellis George will help you get through it a little easier. These are specific to the SP1 version but should be OK for others as well.  Keep in mind that this is a measure of last resort and should only be used if you have no choice but to manually remove WSUS.  This will also remove WIDS so when you're done you'll be able to reinstall and start from scratch.
WARNING: Do Not Do This if you are running WSUS on SBS 2008!  SBS 2008 installs Sharepoint and WSUS on the same server and both applications store their database in Windows Internal Database. Removing Windows Internal Database (MICROSOFT##SSEE) using steps 6-8 will break Sharepoint and anything else you may have installed that relies on Windows Internal Database.
========
1. Please download and install the Windows Installer Cleanup Utility.  To install it simply run msicuu2.exe.
2. Once it is installed go to Start>All Programs>Windows Install Clean Up
3. Scroll through the options and highlight Microsoft Windows Server Update Services 3.0 SP1 (3.1.6001.65)
4. Click remove
5. Open a command prompt and run the following commands:
net stop wsusservice
net stop wsuscertserver
sc delete wsusservice
sc delete wsuscertserver
6. When complete, go back to the Windows Installer Cleanup Utility and highlight Windows Internal Database (MICROSOFT##SSEE) and click remove.
7. Go back to the command line and run the following commands
net stop mssql$microsoft##ssee
sc delete mssql$microsoft##ssee
8. Delete or edit the associated reg keys as noted below:
a. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server and edit the "InstalledInstances" value and remove "MICROSOFT##SSEE"
b. Remove the "MICROSOFT##SSEE" subkey under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server
c. Remove the "MSSQL.2005" subkey under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server
d. Rename the following folder:
\%Windir%\SYSMSI\SSEE\MSSQL.2005\MSSQL\Data
to
\%Windir%\SYSMSI\SSEE\MSSQL.2005\MSSQL\Data.old


如何手工卸载 WSUS 3.0
http://blogs.technet.com/b/gcrsec/archive/2009/08/25/wsus-3-0.aspx

WSUS 3.0 是非常好用的 Windows 平台更新部署工具。使用 WSUS 3.0 时,如果碰到某些控制台或服务相关问题,从快速解决问题角度出发,卸载 WSUS 然后重新安装可能会是比较方便的办法。重装WSUS 时,可以保留重用 WSUS 数据库和已下载的更新文件,这样保留了数据库信息(如更新列表,客户端分组,更新批准等),也不用重新下载之前已经下载好的更新文件。
clip_image002
有时候如果通过 添加/删除程序 卸载 WSUS 失败。我们可以通过手工方式清除 WSUS 的组件。下面的步骤仅供参考。

1. 运行下面的命令行来清理 WSUS 相关安装信息。2C0D7E35-EE6E-4dc7-BA13-2C68AEDEB59D 是 WSUS 3.0 的产品码: 
Msizap T {2C0D7E35-EE6E-4dc7-BA13-2C68AEDEB59D} 
(MISZAP 工具可以从这里下载: http://support.microsoft.com/kb/290301)
2. 执行下面的命令行删除 WSUS 服务

Sc delete wsusservice
3. 在下面的注册表中删除所有WSUS开头的服务名称:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
4. 删除下面的注册表:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Update Services\
5. (可选) 查找注册表,删除所有包含“Update Services”的键值。
(根据我们的经验,这个步骤不是必须的。如果执行下面的步骤后 WSUS 仍然安装失败,请尝试这一步骤。)
6. 删除WSUS安装目录:C:\Program Files\Update Services

(如果有个别文件不能删除。请跳过该文件。根据我们的经验,有时候 C:\Program Files\Update Services\Common 目录下某些文件不能删除,但不会影响重装。)
7. 打开 IIS 管理控制台,删除所有 WSUS 相关的虚拟目录,包括:
  • ApiRemoting30      
  • ClientWebService   
  • Content            
  • DssAuthWebService  
  • Inventory          
  • ReportingWebService
  • Selfupdate         
  • ServerSyncWebService
  • SimpleAuthWebService
  • 在Application Pools下, 删除WsusPool。
8. 一般我们需要保留 WSUS 自带的数据库 Window Internal Database (WID),以便在重新安装 WSUS 时再使用。如果您不需要原来的 WSUS数据信息,或者 WID 服务已经不可用,可以在 添加/删除程序 中移除 WID。或执行:
msiexec /x {CEB5780F-1A70-44A9-850F-DE6C4F6AA8FB} callerid=ocsetup.exe
(请参考:http://technet.microsoft.com/en-us/library/cc708610.aspx)

如果移除 WID 失败,请手工执行下列步骤:
  • 清除 WID 安装信息: Msizap T {CEB5780F-1A70-44A9-850F-DE6C4F6AA8FB}如果有 SUSDB 相关文件:SUSDB.mdf 和 SUSDB_log.ldf, 请手工删除。这两个文件一般存放在 WSUS\UpdateServicesDbFiles 目录下。如果没有这个目录,需要查找一下文件名。 
  • 删除 WID 服务: Sc delete MSSSQL$MICROSOFT##SSEE 
  • 删除目录 c:\Windows\sysmsi\ssee 
  • 删除包含“Windows Internal Database” 的注册表键值:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer如果没有其他数据库,请删除:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server否则可能在安装 WID 时会出错,错误类似:
GetServiceUserGroup failed for MICROSOFT##SSEE, 5
        Error Code: 0x80070534 (1332)
Windows Error Text: 帐户名与安全标识间无任何映射完成。
  Source File Name: sqlca\sqlcax.cpp
Compiler Timestamp: Fri Feb  9 22:35:05 2007
     Function Name: SetInstanceProperty
Source Line Number: 1223
Error Code: 1332
MSI (s) (80!58) [17:39:57:437]: Product: Windows Internal Database -- Error 29528. The setup has encountered an unexpected error while Setting Internal Properties. The error is: 安装时发生严重错误
Error 29528. The setup has encountered an unexpected error while Setting Internal Properties. The error is: 安装时发生严重错误

这是由于 WID 安装文件找不到下面注册表键值对应的用户组:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.2005\Setup] "SQLGroup"="S-1-5-21-1776805508-560418251-1583554535-1109" "FTSGroup"="S-1-5-21-1776805508-560418251-1583554535-1110"
执行完以上步骤后WSUS就完全卸载了。您可以继续重新安装 WSUS 3.0




沒有留言:

張貼留言