提问人:Forlorn Vox 提问时间:11/1/2020 最后编辑:Forlorn Vox 更新时间:12/12/2020 访问量:614
Powershell:如何自动填充“Windows 安全中心”提示窗口的字段以访问网页Powershell: How to automatically populate the fields of a “Windows Security” prompt window to access a web page
Powershell: How to Automatically Populate the Fields of a "Windows Security" Prompt Window to Access a web Page
问:
这是我在 Stack Overflow 上的第一个问题,所以如果它有点含糊不清,请原谅我。如果碰巧是这样,我将非常乐意尽我所能澄清。
因此,我正在尝试自动登录到需要授权才能进行一些网络抓取的 IP。导航到 URL 后,会出现此窗口。是否有方法可以自动填充此窗口中的用户名/密码字段?
这是我到目前为止所拥有的
function Initialize-IE {
param([system.string]$url,
[System.Boolean]$isVisible)
$ie = New-Object -ComObject internetexplorer.application
$ie.visible = $isVisible
$ie.navigate($url)
while ($ie.Busy -eq $true) {Start-Sleep -seconds 1;}
return $ie
}
Initialize-IE -url "10.10.205.63" -isVisible $false
另外一点:我知道这可以使用带有 credential 参数的 invoke-webrequest 来完成。但是,此网页上有一个按钮,要求用户多次单击它,以便执行内联脚本并返回我需要的信息。据我所知,模拟按钮按下的唯一方法是通过 Internet Explorer 对象抓取元素并使用 click() 方法。因此,如果有使用 invoke-webrequest 方法的替代方法,请随时发布它。
答: 暂无答案
评论
Internet options->Security tab->Local intranet->click the custom level button-> Log on