查看windows mstsc远程登陆日志(client ip)

2024-03-31 18:18

本文主要是介绍查看windows mstsc远程登陆日志(client ip),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

最近有个需求,要看一下windows MSTSC的登陆日志。

测试环境:

    win10

参考:

https://social.technet.microsoft.com/Forums/windows/en-US/efabde54-be5e-4be2-bf1b-b146934047e1/logging-ip-adderess-during-remote-desktop-connection?forum=winserverTS

Hi,You may view the Remote Desktop connection client ip address information in the following logs:Event Viewer\Applications and Services Logs\Microsoft\Windows\TerminalServices-LocalSessionManagerEvent Viewer\Applications and Services Logs\Microsoft\Windows\TerminalServices-RemoteConnectionManagerEvent Viewer\Windows Logs\Security  (Event ID: 4624, Logon Type: 10)-TP
Event Viewer\Applications and Services Logs\Microsoft\Windows\TerminalServices-LocalSessionManagerEvent Viewer\Applications and Services Logs\Microsoft\Windows\TerminalServices-RemoteConnectionManagerEvent Viewer\Windows Logs\Security  (Event ID: 4624, Logon Type: 10)-TP

powersherll:

找不到出处了,运行之后在当前目录生成登陆日志。

<#.SYNOPSIS This script reads the event log "Microsoft-Windows-TerminalServices-LocalSessionManager/Operational" from multiple servers and outputs the human-readable results to a CSV.  This data is not filterable in the native Windows Event Viewer.Version: November 9, 2016.DESCRIPTIONThis script reads the event log "Microsoft-Windows-TerminalServices-LocalSessionManager/Operational" from multiple servers and outputs the human-readable results to a CSV.  This data is not filterable in the native Windows Event Viewer.NOTE: Despite this log's name, it includes both RDP logins as well as regular console logins too.Author:Mike Crowleyhttps://BaselineTechnologies.com.EXAMPLE
?.\RDPConnectionParser.ps1 -ServersToQuery Server1, Server2 -StartTime "November 1".LINKhttps://MikeCrowley.us/tag/powershell#>Param([array]$ServersToQuery = (hostname),[datetime]$StartTime = "January 1, 1970"
)foreach ($Server in $ServersToQuery) {$LogFilter = @{LogName = 'Microsoft-Windows-TerminalServices-LocalSessionManager/Operational'ID = 21, 23, 24, 25StartTime = $StartTime}$AllEntries = Get-WinEvent -FilterHashtable $LogFilter -ComputerName $Server$AllEntries | Foreach { $entry = [xml]$_.ToXml()[array]$Output += New-Object PSObject -Property @{TimeCreated = $_.TimeCreatedUser = $entry.Event.UserData.EventXML.UserIPAddress = $entry.Event.UserData.EventXML.AddressEventID = $entry.Event.System.EventIDServerName = $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 ":", "."$FilePath = "$env:USERPROFILE\Desktop\$Date`_RDP_Report.csv"$FilteredOutput | Sort TimeCreated | Export-Csv $FilePath -NoTypeInformationWrite-host "Writing File: $FilePath" -ForegroundColor Cyan
Write-host "Done!" -ForegroundColor Cyan#End

 

 

 

 

这篇关于查看windows mstsc远程登陆日志(client ip)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/864983

相关文章

Linux挂载linux/Windows共享目录实现方式

《Linux挂载linux/Windows共享目录实现方式》:本文主要介绍Linux挂载linux/Windows共享目录实现方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地... 目录文件共享协议linux环境作为服务端(NFS)在服务器端安装 NFS创建要共享的目录修改 NFS 配

基于Python开发Windows自动更新控制工具

《基于Python开发Windows自动更新控制工具》在当今数字化时代,操作系统更新已成为计算机维护的重要组成部分,本文介绍一款基于Python和PyQt5的Windows自动更新控制工具,有需要的可... 目录设计原理与技术实现系统架构概述数学建模工具界面完整代码实现技术深度分析多层级控制理论服务层控制注

Java 日志中 Marker 的使用示例详解

《Java日志中Marker的使用示例详解》Marker是SLF4J(以及Logback、Log4j2)提供的一个接口,它本质上是一个命名对象,你可以把它想象成一个可以附加到日志语句上的标签或戳... 目录什么是Marker?为什么使用Markejavascriptr?1. 精细化的过滤2. 触发特定操作3

Linux中查看操作系统及其版本信息的多种方法

《Linux中查看操作系统及其版本信息的多种方法》在服务器运维或者部署系统中,经常需要确认服务器的系统版本、cpu信息等,在Linux系统中,有多种方法可以查看操作系统及其版本信息,以下是一些常用的方... 目录1. lsb_pythonrelease 命令2. /etc/os-release 文件3. h

Oracle数据库在windows系统上重启步骤

《Oracle数据库在windows系统上重启步骤》有时候在服务中重启了oracle之后,数据库并不能正常访问,下面:本文主要介绍Oracle数据库在windows系统上重启的相关资料,文中通过代... oracle数据库在Windows上重启的方法我这里是使用oracle自带的sqlplus工具实现的方

基于Go语言开发一个 IP 归属地查询接口工具

《基于Go语言开发一个IP归属地查询接口工具》在日常开发中,IP地址归属地查询是一个常见需求,本文将带大家使用Go语言快速开发一个IP归属地查询接口服务,有需要的小伙伴可以了解下... 目录功能目标技术栈项目结构核心代码(main.go)使用方法扩展功能总结在日常开发中,IP 地址归属地查询是一个常见需求:

linux查找java项目日志查找报错信息方式

《linux查找java项目日志查找报错信息方式》日志查找定位步骤:进入项目,用tail-f实时跟踪日志,tail-n1000查看末尾1000行,grep搜索关键词或时间,vim内精准查找并高亮定位,... 目录日志查找定位在当前文件里找到报错消息总结日志查找定位1.cd 进入项目2.正常日志 和错误日

在Android中使用WebView在线查看PDF文件的方法示例

《在Android中使用WebView在线查看PDF文件的方法示例》在Android应用开发中,有时我们需要在客户端展示PDF文件,以便用户可以阅读或交互,:本文主要介绍在Android中使用We... 目录简介:1. WebView组件介绍2. 在androidManifest.XML中添加Interne

SpringBoot日志级别与日志分组详解

《SpringBoot日志级别与日志分组详解》文章介绍了日志级别(ALL至OFF)及其作用,说明SpringBoot默认日志级别为INFO,可通过application.properties调整全局或... 目录日志级别1、级别内容2、调整日志级别调整默认日志级别调整指定类的日志级别项目开发过程中,利用日志

深度剖析SpringBoot日志性能提升的原因与解决

《深度剖析SpringBoot日志性能提升的原因与解决》日志记录本该是辅助工具,却为何成了性能瓶颈,SpringBoot如何用代码彻底破解日志导致的高延迟问题,感兴趣的小伙伴可以跟随小编一起学习一下... 目录前言第一章:日志性能陷阱的底层原理1.1 日志级别的“双刃剑”效应1.2 同步日志的“吞吐量杀手”