如何login从公司外部连接到terminal服务器的IP?

我们有用户RDP公司的terminal服务器。 有没有一种方法可以跟踪用户连接的公司之外的IP地址?

我知道有事件日志中的terminal服务下有可用的日志,但我没有看到任何公共的IP地址在那里从公司以外的远程连接。

任何想法?

您的问题不提供有关用户如何从外部连接到terminal服务器的信息。 我想贵公司有网关,把请求从互联网redirect到terminal服务器。 如果是这样,你可以在网关日志中得到这个信息。

但是,如果你的terminal服务器直接连接到互联网,出于某种原因拥有公共IP,或许,这可以帮助你:

<# Features: 1) This script reads the event log "Microsoft-Windows-TerminalServices-LocalSessionManager/Operational" from multiple servers and outputs the human-readable results to a CSV. Instructions: 1) Before you run, edit this line to include one or several of your own servers. Requirements: 1) TBD April 8 2015 - Version 0.2 Mike Crowley http://BaselineTechnologies.com #> $SessionHosts = @('Server2', 'Server3', 'Server4', 'Server5') foreach ($Server in $SessionHosts) { $LogFilter = @{ LogName = 'Microsoft-Windows-TerminalServices-LocalSessionManager/Operational' ID = 21, 23, 24, 25 } $AllEntries = Get-WinEvent -FilterHashtable $LogFilter -ComputerName $Server $AllEntries | Foreach { $entry = [xml]$_.ToXml() [array]$Output += New-Object PSObject -Property @{ TimeCreated = $_.TimeCreated User = $entry.Event.UserData.EventXML.User IPAddress = $entry.Event.UserData.EventXML.Address EventID = $entry.Event.System.EventID ServerName = $Server } } } $FilteredOutput += $Output | Select TimeCreated, User, ServerName, IPAddress, @{Name='Action';Expression={ if ($_.EventID -eq '21'){"logon"} if ($_.EventID -eq '22'){"Shell start"} if ($_.EventID -eq '23'){"logoff"} if ($_.EventID -eq '24'){"disconnected"} if ($_.EventID -eq '25'){"reconnection"} } } $Date = (Get-Date -Format s) -replace ":", "." $FilteredOutput | Sort TimeCreated | Export-Csv $env:USERPROFILE\Desktop\$Date`_RDP_Report.csv -NoTypeInformation #End 

Microsoft Technet网站的这个PowerShell脚本parsing有关RDP会话信息(包括客户端IP)的事件日志,并将可读的结果输出到CSV。