终端服务器会话创建失败

Microsoft.Windows.Server.2008.TerminalServicesRole.Service.TerminalServer.EventCollection.1036 (Rule)

Knowledge Base article:

解决方法

此问题可能表示终端服务器上有另一个应用程序与远程桌面协议 (RDP) 正在使用相同的 TCP 端口。分配给 RDP 的默认端口是 3389。

若要解决此问题,请确定与 RDP 使用相同端口的应用程序。如果无法更改该应用程序的端口分配,请通过编辑注册表更改分配给 RDP 的端口。在编辑注册表后,必须重新启动“终端服务”服务。在重新启动“终端服务”服务后,您应确认已正确更改 RDP 端口。

若要执行这些任务,请参阅以下各节。

确定与 RDP 使用相同端口的应用程序

可以运行 netstat 工具来确认终端服务器上是否还有另一个应用程序正在使用端口 3389(或分配的 RDP 端口)。

若要使用 netstat,请执行以下操作:

若要确定正在使用端口 3389(或分配的 RDP 端口)的应用程序,请使用 tasklist 命令行工具和从 netstat 工具获得的 PID 信息。

更改分配给 RDP 的端口

您应确定此应用程序是否可以使用另一个端口。如果无法更改此应用程序的端口,则将必须更改分配给 RDP 的端口。

重要说明:Microsoft 不建议更改分配给 RDP 的端口。

如果必须更改分配给 RDP 的端口,则您必须编辑注册表。

若要执行此过程,您必须拥有本地 Administrators 组成员身份,或者您必须被委派了适当的权限。

若要更改分配给 RDP 的端口,请执行以下操作:

警告:注册表编辑不当可能会严重损坏您的系统。在更改注册表之前,您应备份任何有价值的数据。

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations

注意:RDP-TCP 为默认连接名称。若要更改终端服务器上的特定连接的端口,请选择“WinStations”注册表项下的连接。

重新启动“终端服务”服务

若要使 RDP 端口的分配更改生效,请停止并启动“终端服务”服务。

若要执行此过程,您必须拥有本地 Administrators 组成员身份,或者您必须被委派了适当的权限。

若要停止并启动“终端服务”服务,请执行以下操作:

确认 RDP 端口已更改

若要确认 RDP 端口分配已更改,请使用 netstat 工具。

若要使用 netstat,请执行以下操作:

重要说明:默认情况下,远程桌面连接和终端服务器 Web 客户端使用端口 3389 来连接到终端服务器。如果更改终端服务器上的 RDP 端口,您将需要修改远程桌面连接和终端服务器 Web 客户端使用的端口。有关详细信息,请参阅以下 Microsoft 知识库文章:

Element properties:

TargetMicrosoft.Windows.Server.2008.TerminalServicesRole.Service.TerminalServer
CategoryEventCollection
EnabledTrue
Event_ID1036
Event SourceMicrosoft-Windows-TerminalServices-RemoteConnectionManager
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
RemotableTrue
Alert Message
终端服务器会话创建失败
{0}
Event LogSystem

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.Windows.EventProvider Default
Alert WriteAction System.Health.GenerateAlert Default

Source Code:

<Rule ID="Microsoft.Windows.Server.2008.TerminalServicesRole.Service.TerminalServer.EventCollection.1036" Enabled="onStandardMonitoring" Target="Microsoft.Windows.Server.2008.TerminalServicesRole.Service.TerminalServer" ConfirmDelivery="true" Remotable="true" Priority="Normal" DiscardLevel="100">
<Category>EventCollection</Category>
<DataSources>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.EventProvider">
<ComputerName>$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<LogName>System</LogName>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="UnsignedInteger">EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="UnsignedInteger">1036</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">PublisherName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">Microsoft-Windows-TerminalServices-RemoteConnectionManager</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="Alert" TypeID="SystemHealth!System.Health.GenerateAlert">
<Priority>1</Priority>
<Severity>2</Severity>
<AlertName/>
<AlertDescription/>
<AlertOwner/>
<AlertMessageId>$MPElement[Name="Microsoft.Windows.Server.2008.TerminalServicesRole.Service.TerminalServer.EventCollection.1036.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>$Data/EventDescription$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue>$Data/LoggingComputer$</SuppressionValue>
</Suppression>
<Custom1/>
<Custom2/>
<Custom3/>
<Custom4/>
<Custom5/>
<Custom6/>
<Custom7/>
<Custom8/>
<Custom9/>
<Custom10/>
</WriteAction>
</WriteActions>
</Rule>