【发布时间】:2020-01-31 01:44:04
【问题描述】:
我正试图弄清楚如何通过 PowerShell 从 AD 服务器上的管理员帐户到网络上的任何计算机进行远程屏幕截图。
到目前为止,我得到了以下内容。
$ComputerName = '<THECOMPUTER>'
copy-item "C:\Public\Software\Take-Screenshot.ps1" "\\$ComputerName\C$\"
Invoke-Command -ComputerName $ComputerName -ScriptBlock {
powershell -nop -c "C:\Take-Screenshot.ps1"
}
Take-Screenshot.ps1 来自here,但我已将以下内容添加到脚本底部以实际运行该函数。
Take-ScreenShot -screen -file C:\s.png -imagetype png
截图后我会复制回宿主,但问题是图片全黑。
我在想这可能是因为powershell正在运行程序,但没有附加会话,所以真的没有屏幕??
【问题讨论】:
-
首先创建远程 PSSession 是否有助于渲染屏幕截图? docs.microsoft.com/en-us/powershell/module/…
-
不,还是一张空白图片
-
你可以试试 NirSoft.net 的 nircmd.exe nircmd.nirsoft.net/savescreenshotfull.html, nircmd.nirsoft.net/savescreenshot.html 它对我有用。
标签: powershell active-directory screen-capture