powershell - 使用 Powershell 登录 DirectAdmin

标签 powershell

我正在尝试使用 Powershell 登录我的主机 DirectAdmin 页面。但是我似乎无法绕过登录按钮。尝试了几种提交论坛的方法,但都没有任何作用。

有人知道登录或尝试登录的正确代码行吗?

$url = "http://perkele.nl:2222/"
$username = "**"
$password = "**"
$ie = New-Object -com InternetExplorer.Application
$ie.visible = $true; 
$ie.navigate($url); 

$ie.Document.getElementByID('username').value=$username
$ie.Document.getElementByID("password").value=$password

提交用户名和密码没问题。登录按钮似乎不像通常的表单那样是合法的提交按钮。

欢迎任何帮助,谢谢!

最佳答案

您可以尝试在脚本底部添加这一行:

$ie.Document.getElementById("form").submit()

关于powershell - 使用 Powershell 登录 DirectAdmin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18939113/

相关文章:

c# - 提供 .NET 方法作为委托(delegate)回调

.net - 在 PowerShell 中发送任意 FTP 命令

python - 如何通过管道将 Unicode 传输到 PowerShell 中的 native 应用程序

powershell - 如何让这个 PowerShell 脚本更快地解析大文件?

powershell 哈希表操作

powershell - 管道foreach循环CSV PowerShell

c# - 使用 .NET 和 Powershell 远程推送 PFX 证书和私钥

windows - Powershell 配色方案?

powershell - 挂载 VHD 并获取驱动器号

azure - 在 Azure Powershell Runbook 中使用 "Parsed-HTML"时, "invoke-webrequest"字段为空