0
我試圖通過登錄到電子郵件來激活帳戶的過程自動化,當我不在以下代碼的業務網絡上時,它有效。Powershell私人啓動IE並登錄到頁面
$username = "user"
$password = "pass"
$url = "url"
$ie = New-Object -com InternetExplorer.Application
$ie.visible=$true
$ie.navigate($url)
while ($ie.Busy -eq $true){Start-Sleep -seconds 1;}
$usernamefield = $ie.Document.getElementByID('UsernameTextBox')
$usernamefield.value = $username
$passwordfield = $ie.Document.getElementByID('PasswordTextBox')
$passwordfield.value = $password
$ie.document.getElementById("ctl00_ContentPlaceHolder1_SubmitButton").click()`
我的問題是,一旦連接到商業網絡則使用SSO登錄,所以我不明白擺在用戶名和密碼的選項。爲了能夠輸入用戶名和密碼,我需要以私人模式啓動IE。我已經能夠用啓動進程命令私人啓動IE,但是我找不到一種方法來選擇窗口來輸入用戶名和密碼。
有沒有一種方法可以使用powershell登錄到私人瀏覽器的網站?
更好'啓動過程iexplore.exe -ArgumentList' - 私人http:// bogus.bogus'' – DisplayName