Terminal Server session creation failed

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

Knowledge Base article:

Resolutions

This problem could indicate that another application on the terminal server is using the same TCP port as the Remote Desktop Protocol (RDP). The default port assigned to RDP is 3389.

To resolve this issue, determine which application is using the same port as RDP. If the port assignment for that application cannot be changed, change the port assigned to RDP by editing the registry. After editing the registry, you must restart the Terminal Services service. After you restart the Terminal Services service, you should confirm that the RDP port has been correctly changed.

To perform these tasks, refer to the following sections.

Determine which application is using the same port as RDP

You can run the netstat tool to determine if port 3389 (or the assigned RDP port) is being used by another application on the terminal server.

To use netstat:

To determine which application is using port 3389 (or the assigned RDP port), use the tasklist command-line tool along with the PID information from the netstat tool.

Change the port assigned to RDP

You should determine if this application can use a different port. If you cannot change the application’s port, you will have to change the port assigned to RDP.

Important:  Microsoft does not recommend changing the port assigned to RDP.

If you have to change the port assigned to RDP, you must edit the registry.

To perform this procedure, you must have membership in the local Administrators group, or you must have been delegated the appropriate authority.

To change the port assigned to RDP:

Caution:  Incorrectly editing the registry might severely damage your system. Before making changes to the registry, you should back up any valued data.

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

Note:  RDP-TCP is the default connection name. To change the port for a specific connection on the terminal server, select the connection under the WinStations key.

Restart the Terminal Services service

For the RDP port assignment change to take effect, stop and start the Terminal Services service.

To perform this procedure, you must have membership in the local Administrators group, or you must have been delegated the appropriate authority.

To stop and start the Terminal Services service:

Confirm that the RDP port has changed

To confirm that the RDP port assignment has been changed, use the netstat tool.

To use netstat:

Important:  Remote Desktop Connection and the Terminal Server Web Client use port 3389, by default, to connect to a terminal server. If you change the RDP port on the terminal server, you will need to modify the port used by Remote Desktop Connection and the Terminal Server Web Client. For more information, see the following Microsoft Knowledge Base Articles:

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
Terminal Server session creation failed
{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>