Friday, 15 November 2013

Login Barracuda using script

If you want to log in barracuda client using vbscript. Here below is the solution for you. Thinking Why on earth someone would do it. There are incidence where one has to log in on multiple system to update windows manually and has to log in barracuda client on every system. One can simple push script remotely on multiple computer and may log in all of them at the same time.





I have used Google.com in the code. Please use website which is blocked in your case to come up with login page where the script will perform rest coding.

#Start

WScript.Quit Main
Function Main
  Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
  IE.Visible = True
  IE.Navigate "http://www.google.com"
  Wait IE
  With IE.Document
    .getElementByID("login_field").value = "put your username"
    .getElementByID("password_field").value = "Put your password"
    .getElementByID("login_form_action").Click
  End With
End Function
Sub Wait(IE)
  Do
    WScript.Sleep 500
  Loop While IE.ReadyState < 4 And IE.Busy
  Do
    WScript.Sleep 500
  Loop While IE.ReadyState < 4 And IE.Busy
End Sub
Sub IE_OnQuit
  On Error Resume Next
  WScript.StdErr.WriteLine "IE closed before script finished."
  WScript.Quit
End Sub

#End

Regards, IIS

No comments:

Post a Comment

Install Multiple Software with a Click