$url = "https://example.sharepoint.com/"
$username="[email protected] "
$password="Password"
$ie = New-Object -com internetexplorer.application;
$ie.visible = $true;
$ie.navigate($url);
while ($ie.Busy -eq $true)
{
Start-Sleep -Milliseconds 1000;
}
$ie.Document.getElementById("login").value = $username
$ie.Document.getElementByID("Passwd").value=$password
$ie.Document.getElementById("cred_sign_in_button").Click();
Currently I have this code which runs in powershell (not sharepoint powershell) it first opens Internet explorer and second enters the login and password.
What I havent been able to do though is to get the code to select the sign in button. Does anyone know what value I should have to get the button to select?
Thanks
It should be this part of the code. $ie.Document.getElementById("cred_sign_in_button").Click();
This is the source code for the sign in button.
<span id="cred_sign_in_button" tabindex="11" onclick="Post.SubmitCreds();return false;"
class="button normaltext cred_sign_in_button refresh_domain_state" role="button">Sign in</span>
<div id="recover_container" class="subtext smalltext">
<span>