wsus微软更新服务 debug工具使用

来源:互联网 发布:sql表怎么保存到优盘 编辑:程序博客网 时间:2024/05/16 05:35
 wsus微软更新服务 debug工具使用
 

   用了这么久的wsus,感觉它非常的娇贵,服务器上稍微有个风吹草动。马上会提示你无法连接,或者是无法自动更新。往往最好的解决办法是重装一下wsus。这次我厌烦了重装,在以前痛苦调试的基础上,再调试一下吧。

   前两天在服务器上启用了第二块网块,安装了短信平台。因为移动对短信平台出口地址有要求,所以加了一条固定路由,本身短信平台使用apache+mysql+jsp,应该是没有什么影响的。但是报错无法连接了,具体的错误

[code]WSUS 管理控制台无法通过远程 API 连接到 WSUS 服务器。

请确保 Update Services 服务、IIS 和 SQL 正在该服务器上运行。如果该问题仍然存在,请尝试重新启动 IIS、SQL 和 Update Services 服务。

WSUS 管理控制台遇到意外错误。这可能是暂时错误;请尝试重新启动该管理控制台。如果此错误仍然存在,

请尝试通过删除 %appdata%\Microsoft\MMC\ 下的 wsus 文件来删除该控制台的永久性首选项。


System.IO.IOException -- 由于意外的数据包格式,握手失败。

Source
System

Stack Trace:
   在 System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
   在 System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
   在 System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
   在 System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
   在 System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
   在 System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
   在 System.Net.TlsStream.CallProcessAuthentication(Object state)
   在 System.Threading.ExecutionContext.runTryCode(Object userData)
   在 System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   在 System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
   在 System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   在 System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   在 System.Net.ConnectStream.WriteHeaders(Boolean async)
** this exception was nested inside of the following exception **


System.Net.WebException -- 基础连接已经关闭: 发送时发生错误。

Source
Microsoft.UpdateServices.Administration

Stack Trace:
   在 Microsoft.UpdateServices.Administration.AdminProxy.CreateUpdateServer(Object[] args)
   在 Microsoft.UpdateServices.Administration.AdminProxy.GetUpdateServer(String serverName, Boolean useSecureConnection, Int32 portNumber)
   在 Microsoft.UpdateServices.UI.AdminApiAccess.AdminApiTools.GetUpdateServer(String serverName, Boolean useSecureConnection, Int32 portNumber)
   在 Microsoft.UpdateServices.UI.SnapIn.Scope.ServerSummaryScopeNode.GetUpdateServer(PersistedServerSettings settings)
   在 Microsoft.UpdateServices.UI.SnapIn.Scope.ServerSummaryScopeNode.ConnectToServer()
   在 Microsoft.UpdateServices.UI.SnapIn.Scope.ServerSummaryScopeNode.get_ServerTools()[code]

       微软本身提供了一个工具,在安装目录tool里边。wsusutil.exe,主要的参数及功能如下。

checkhealth
检查服务器组件运行状态,在事件查看器应用程序栏可查看结果

configuressl
更改IIS配置后刷新注册表项

deletefrontendserver
从数据可中删除服务器记录

listinactiveapprovals
返回因为修改服务器语言设置导致不活动的批准列表

removeinactiveapprovals
删除因为服务器语言设置不当造成的不活动的更新审批

export and import
导入和导出更新元数据,用于多台WSUS之间的更新同步

healthmonitoring
在数据库中配置状态检视值


listfrontendservers
列出数据库中服务器信息

movecontent
更改WSUS服务器更新文件的储存位置。对于当前储存文件磁盘空间不足时就需要使用了。
movecontent <content path> <log file> [-skipcopy]
<content path>:内容文件的新根目录。路径必须存在。
<log file>    :要创建的日志文件的路径和文件名。
-skipcopy     :表示只应更改服务器配置,
                 不应复制内容文件。

reset
检查WSUS数据库中每个数据元是否于本地储存的更新文件相同,如果丢失或损坏,下次链接更新服务器将重新下载更新

deleteunneededrevisions
删除不在更新的数据元,运行此命令必须要先关掉控制台和IIS站点服务

usecustomwebsite
更改wsus web服务端口80为8530,可反向操作

第二个工具wsusdebugtool.exe安装目录里没有,需要到微软的wsus主页中去下载,主要功能

wsusdebugtool.exe /tool:purgeunneededfiles
删除WSUS中已拒绝安装的补丁

wsusdebugtools.exe /tool:setforegrounddownload
不使用BITS下载更新,直接连接下载

wsusdebugtool.exe /tool:getbitsstatus
查看bits工作状态

wsusdebugtool.exe /tool:getconfiguration
查看wsus服务设置信息

WsusDebugTool.exe /Tool:GetLogs /OutputCab:c:\ServerLogs.cab
导出WSUS服务器配置及安装等日志进行DEBUG

最常用的就是setforgrounddownload了,可以明显提高补丁下载速度。

 

根据我的情况,本能地选择了wsusutil.exe" usecustomwebsite true.将服务端口更改一下。连接OK。