title: Trying to use Powershell to automate a login to an IP phone and then reboot it.
body: <p>I am trying to create a Powershell script that will open Internet Explorer to the IP address of an IP phone, input user credintials, log in, and then click on the reboot option.  </p>
  
  <p>I am having issues with getting the script to get beyond opening the web portal though.  Here is my Powershell script.</p>
  
  <pre><code>&lt;#
  Created:  November 8, 2017
  Version 1.0
  Description:  Launch Internet Explorer to the specified URL, log into the site, and then click the reboot command on the page.
  Notes:
  
  
  
  #&gt;
  
  #Set-ExecutionPolicy RemoteSigned
  
  # Edit this to be the URL or IP address of the site to be launched
  
  $Url = "10.0.4.239"
  
  # Edit this to be the UserName
  
  $Username = "admin"
  
  # Edit this to be the corresponding Password
  
  $Password = "admin"
  
  # Invoke Internet Explorer
  
  $IE = New-Object -com internetexplorer.application;
  $IE.Visible = $true;
  $IE.navigate($url);
  
  # Wait a few secconds for the page to load
  
  while ($IE.Busy -eq $true)
  
  {
  
    Start-Sleep -Seconds 4;
  
  }
  
  &lt;#
  
  The following UsernameElement, PasswordElement, and LoginElement need to be modified first.
  
  #&gt;
  
  $IE.Document.getElementByClassName("gwt-TextBox").value = $username;
  $IE.Document.getElementByClassName("gwt-PasswordTextBox").value = $Password;
  $IE.Document.getElementByClassName("gwt-Button").Click();
  
  do
     {
      Sleep 25
     }
     while ($ie.Busy -eq "True") 
  </code></pre>
  
  <p>Here is a screen shot of the errors that I receive.</p>
  
  <p><a href="https://i.stack.imgur.com/yAnCh.png" rel="nofollow noreferrer">Powershell error</a></p>
  
  <p>Here is the source code for the input fields and login button.</p>
  
  <p><a href="https://i.stack.imgur.com/W1KNs.png" rel="nofollow noreferrer">WebApp Source</a> </p>
  
  <p>Thanks for all the help.</p>