查看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

相关文章

Spring Boot 实现 IP 限流的原理、实践与利弊解析

《SpringBoot实现IP限流的原理、实践与利弊解析》在SpringBoot中实现IP限流是一种简单而有效的方式来保障系统的稳定性和可用性,本文给大家介绍SpringBoot实现IP限... 目录一、引言二、IP 限流原理2.1 令牌桶算法2.2 漏桶算法三、使用场景3.1 防止恶意攻击3.2 控制资源

基于Python开发Windows屏幕控制工具

《基于Python开发Windows屏幕控制工具》在数字化办公时代,屏幕管理已成为提升工作效率和保护眼睛健康的重要环节,本文将分享一个基于Python和PySide6开发的Windows屏幕控制工具,... 目录概述功能亮点界面展示实现步骤详解1. 环境准备2. 亮度控制模块3. 息屏功能实现4. 息屏时间

在Windows上使用qemu安装ubuntu24.04服务器的详细指南

《在Windows上使用qemu安装ubuntu24.04服务器的详细指南》本文介绍了在Windows上使用QEMU安装Ubuntu24.04的全流程:安装QEMU、准备ISO镜像、创建虚拟磁盘、配置... 目录1. 安装QEMU环境2. 准备Ubuntu 24.04镜像3. 启动QEMU安装Ubuntu4

Windows下C++使用SQLitede的操作过程

《Windows下C++使用SQLitede的操作过程》本文介绍了Windows下C++使用SQLite的安装配置、CppSQLite库封装优势、核心功能(如数据库连接、事务管理)、跨平台支持及性能优... 目录Windows下C++使用SQLite1、安装2、代码示例CppSQLite:C++轻松操作SQ

SpringBoot项目配置logback-spring.xml屏蔽特定路径的日志

《SpringBoot项目配置logback-spring.xml屏蔽特定路径的日志》在SpringBoot项目中,使用logback-spring.xml配置屏蔽特定路径的日志有两种常用方式,文中的... 目录方案一:基础配置(直接关闭目标路径日志)方案二:结合 Spring Profile 按环境屏蔽关

基于Python实现一个Windows Tree命令工具

《基于Python实现一个WindowsTree命令工具》今天想要在Windows平台的CMD命令终端窗口中使用像Linux下的tree命令,打印一下目录结构层级树,然而还真有tree命令,但是发现... 目录引言实现代码使用说明可用选项示例用法功能特点添加到环境变量方法一:创建批处理文件并添加到PATH1

SpringBoot服务获取Pod当前IP的两种方案

《SpringBoot服务获取Pod当前IP的两种方案》在Kubernetes集群中,SpringBoot服务获取Pod当前IP的方案主要有两种,通过环境变量注入或通过Java代码动态获取网络接口IP... 目录方案一:通过 Kubernetes Downward API 注入环境变量原理步骤方案二:通过

Windows的CMD窗口如何查看并杀死nginx进程

《Windows的CMD窗口如何查看并杀死nginx进程》:本文主要介绍Windows的CMD窗口如何查看并杀死nginx进程问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地... 目录Windows的CMD窗口查看并杀死nginx进程开启nginx查看nginx进程停止nginx服务

Golang 日志处理和正则处理的操作方法

《Golang日志处理和正则处理的操作方法》:本文主要介绍Golang日志处理和正则处理的操作方法,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考... 目录1、logx日志处理1.1、logx简介1.2、日志初始化与配置1.3、常用方法1.4、配合defer

Windows 系统下 Nginx 的配置步骤详解

《Windows系统下Nginx的配置步骤详解》Nginx是一款功能强大的软件,在互联网领域有广泛应用,简单来说,它就像一个聪明的交通指挥员,能让网站运行得更高效、更稳定,:本文主要介绍W... 目录一、为什么要用 Nginx二、Windows 系统下 Nginx 的配置步骤1. 下载 Nginx2. 解压