我的目标:
有些时候脚本有效,有时会出错:
$Url = “www.microsoft.com” # not this website , but OBIEE report link
$Username="user_name"
$Password="password"
$IE = New-Object -com internetexplorer.application;
$IE.visible = $true;
$IE.navigate($url);
while ($IE.Busy -eq $true)
{
Start-Sleep -Milliseconds 2000;
}
$IE.Document.getElementById("UsernameElement").value = $Username
$IE.Document.getElementByID("PasswordElement").value=$Password
$IE.Document.getElementById("SubmitElement").Click()
Start-Sleep 10
$IE.Document.getElementById("logout").Click()
$IE.quit();
这是我得到的错误:800704a6
+Categoryinfo :Resourceunavailable(:) [newobject] , COMExecption