加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

windows – 如何找出运行runas应用程序的人员?

发布时间:2020-12-14 05:31:50 所属栏目:Windows 来源:网络整理
导读:背景: 在我的组织中有一个我们用于某些关键功能的应用程序,但它仅在作为特定用户运行时才有效. 原因是应用程序将其大量配置存储为本地用户会话,因此它成为多用户噩梦,这意味着我们必须复制大量工作. 我们已经分配了一个用户来运行应用程序,并通过设置runas
背景:

在我的组织中有一个我们用于某些关键功能的应用程序,但它仅在作为特定用户运行时才有效.

原因是应用程序将其大量配置存储为本地用户会话,因此它成为多用户噩梦,这意味着我们必须复制大量工作.

我们已经分配了一个用户来运行应用程序,并通过设置runas桌面快捷方式找到了解决方案.问题是我们发现应用程序无法同时运行多次.它只允许每个并发用户运行1个实例.

我用于应用程序的快捷键代码:

C:WindowsSystem32runas.exe /user:mydomainrunas_user /savecreds "C:Program FilesMyAppMyApp.exe"

因此,我一直试图确定我如何看到谁正在使用“runas”应用程序,所以我可以让他们优雅地关闭它.
任务管理器仅显示用户名中的“runas_user”,但我认为必须有一些方法来确定谁运行它或哪个用户会话正在查看它.

题:

有什么方法可以找出当前正在运行应用程序的(最好使用PowerShell或其他一些脚本)吗?

解决方法

Windows安全事件日志应显示此信息.所有Windows 2008身份验证事件都是事件ID 4624(通过)或4625(失败).将它与登录类型相结合可以得到你想要的.

关于sans.org上this PDF的登录类型的大量细节(从第10页开始).我认为您最感兴趣的部分是“3.7 NewCredentials”:

Using RunAs command to start a program under a different user account
with the /netonly switch,Windows records a logon/logoff event with
logon type 9. When starting a program with RunAs using /netonly,the
program executes on the local computer as the user currently logged on
as but for any connections to other computers on the network,Windows
connects to those computers using the account specified on the RunAs
command. Without /netonly Windows runs the program on the local
computer and on the network as the specified user and records the
logon event with logon type 2

使用PowerShell获取事件ID和登录类型的快速而脏的方法:

$recentSecLog = 
Get-EventLog -LogName Security -Newest 1000 | Where {$_.EventID -match "4624|4625"}

$recentSecLog | Where {$_.message -match "LogonsType:s+9"}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读