2014-03-31 4 views
0

표준 Windows 로그인 화면에 보고서 서버에 자동으로 일부 자격 증명을 삽입하는 스크립트를 만들려고했습니다. 내가 지금까지 가지고Windows 로그인 팝업에 자격 증명을 삽입하십시오.

: 정상적인 웹 사이트를 사용하는 경우

$ie = new-Object -com internetexplorer.application; 
$ie.visible = $true; 
$ie.navigate($url); 
while ($ie.Busy -eq $true) 
{ 
    start-sleep -milliseconds 1000; 
} 
$ie.Document.getElementById(“user_email”).value = $username 
$ie.Document.getElementByID(“user_password”).value=$password 
$ie.Document.getElementById(“commit”).Click(); 
$ie.fullscreen = $true; 
$cmd.Quit(); 

이 스크립트는 잘 작동

하지만 일을 내가 할 수를 변경해야합니다 (브라우저가 웹 사이트 자체에있는 것) 웹 사이트를로드하기 전에 인증을 요청할 때 내 자격 증명을 삽입 하시겠습니까? (윈도우 보안 창)

답변

1

찾을 솔루션, 그것은 꽤 아니지만, 그것은 작동 : 나는 더 나은 해결책을 찾을 경우

$wshell = New-Object -com WScript.Shell 
$wshell.Run("iexplore.exe $url") 
Start-Sleep 1 

$wshell.sendkeys("$username") 
$wshell.sendkeys("{TAB}") 
$wshell.sendkeys("$password") 
$wshell.sendkeys("{TAB}") 
$wshell.sendkeys("{ENTER}") 

, 내가 그것을 게시하거나 게시 주시기해야합니다 것입니다 귀하의 자신 : P

관련 문제