是否可以编写一个以远程工作站ID作为输入并在该工作站上打开regedit的脚本?
如果你知道我的意思的话,这和从EVTX获取事件日志的概念是一样的。
发布于 2015-12-02 13:03:26
这也一直困扰着我,没有打开远程regedit窗口的原生方式。
但是,您可以使用这种快速而肮脏的方法来完成它:
function Open-RemoteRegistry ($computerName = "127.0.0.1") {
#add needed assemblies
Add-Type -AssemblyName Microsoft.VisualBasic
Add-Type -AssemblyName System.Windows.Forms
#start regedit
regedit
#wait for it to start
Start-Sleep -Seconds 1
#activate regedit window
[Microsoft.VisualBasic.Interaction]::AppActivate("Regedit")
#send Alt F C
[System.Windows.Forms.SendKeys]::SendWait("%FC")
#wait for dialog
Start-Sleep -Seconds 1
#insert computer name and send enter
[System.Windows.Forms.SendKeys]::SendWait("$computerName{ENTER}")
#profit
}
Open-RemoteRegistry (Read-Host "Please provide computer name or IP address")https://stackoverflow.com/questions/34030813
复制相似问题