Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ember.js/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell 同一网络上远程桌面的屏幕截图_Powershell_Screenshot_Monitoring_Rdp_Administration - Fatal编程技术网

Powershell 同一网络上远程桌面的屏幕截图

Powershell 同一网络上远程桌面的屏幕截图,powershell,screenshot,monitoring,rdp,administration,Powershell,Screenshot,Monitoring,Rdp,Administration,我是一名IT公司的新员工,是一名系统信息管理员,我的老板给了我一个项目:在不通知他们的情况下拍摄网络中一台远程机器的屏幕截图。 他们也不应该断开与会话的连接。 我正在寻找任何3d派对软件(免费或其他)或任何powershell脚本来帮助我完成此任务。 我的进展: 用于在本地保存屏幕截图的PowerShell脚本: $Path = "C:\Users\Naskez\Desktop\Screenshots" If (!(test-path $path)) { New-Item

我是一名IT公司的新员工,是一名系统信息管理员,我的老板给了我一个项目:在不通知他们的情况下拍摄网络中一台远程机器的屏幕截图。 他们也不应该断开与会话的连接。 我正在寻找任何3d派对软件(免费或其他)或任何powershell脚本来帮助我完成此任务。 我的进展:


用于在本地保存屏幕截图的PowerShell脚本:

$Path = "C:\Users\Naskez\Desktop\Screenshots"
If (!(test-path $path)) {
New-Item -ItemType Directory -Force -Path $path
}
Add-Type -AssemblyName System.Windows.Forms
$screen = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds

$image = New-Object System.Drawing.Bitmap($screen.Width, $screen.Height)

$graphic = [System.Drawing.Graphics]::FromImage($image)
$point = New-Object System.Drawing.Point(0, 0)
$graphic.CopyFromScreen($point, $point, $image.Size);
$cursorBounds = New-Object System.Drawing.Rectangle([System.Windows.Forms.Cursor]::Position, [System.Windows.Forms.Cursor]::Current.Size)

[System.Windows.Forms.Cursors]::Default.Draw($graphic, $cursorBounds)
$screen_file = "$Path\" + $env:computername + "_" + $env:username + "_" + "$((get-date).tostring('yyyy.MM.dd-HH.mm.ss')).png"

$image.Save($screen_file, [System.Drawing.Imaging.ImageFormat]::Png)
之后,如果要从RDS服务器(或桌面窗口,其中允许多个并发RDP连接)获取桌面屏幕截图,必须首先获取远程计算机上的用户会话ID。在以下PowerShell脚本中指定远程计算机/服务器的名称和用户帐户:

$ComputerName = "nld-rds1"
$RDUserName = "h.jansen"
$quser = (((query user /server:$ComputerName) -replace '^>', '') -replace '\s{2,}', ',' | ConvertFrom-Csv)
$usersess=$quser | where {$_.USERNAME -like $RDUserName -and $_.STATE -eq "Active"}
$usersessID=$usersess.ID
最后,使用正确的sessionID执行Psexec:

.\PsExec.exe -s -i $usersessID \\$ComputerName powershell.exe -executionpolicy bypass -WindowStyle Hidden -file "\\nld-fs01\Screen\CaptureLocalScreen.ps1"

问题是:我的公司不允许多个RDP连接。因此,如果我尝试这样做,我必须断开它们

任何解决方案或提示都将不胜感激

注意:上面列出的PowerShell解决方案不是我的。原始链接如下:

“在不通知他们的情况下拍摄网络中远程机器的屏幕截图”对我来说是非常非法的,因为它在监视登录用户。你应该告诉你的老板你不能接受这样的任务。我们是ISS团队的一员,我们正在监控用户流量和活动。那怎么违法?你真的认为监视用户是合法的?那是哪个国家?