Jump to content
AfsarP1

Automating a process of Citrix login - (Moved)

Recommended Posts

Hi Team 

I'm new to AutoIt, I've been looking at videos and articles to understand AutoIt and automating a every-day work process. Below is what i'm trying to achieve. 

1. Open a Citrix URL

2. Enter the username and password

3. Login

I'm able to do this successfully by hard coding the values(URL, Username and Password). What I want to achieve is to create an executable file which does this job for different users and obviously each user will have their own credentials. How do I make this dynamic. Meaning allowing user's to enter their own credentials. 

In some cases, the url will also change for some users. How can I make this as well dynamic. Someone suggested me to use CMD but i'm having a real trouble using it. Would someone be able to guide me here?

Here is the code i've built:

 

#include <IE.au3>

$Url = "https://testurl.com"
$Username = 'testusername' ;This should be replaced with End user's username
$Password = "testpassword" ;This should be replaced with End user's password

$CmdLine[0] = $Url  ;  NOT SURE HOW THIS WORKS, WAS TRYING DIFFERENT THINGS.
$CmdLine[0] = $Username ;  NOT SURE HOW THIS WORKS, WAS TRYING DIFFERENT THINGS.
$CmdLine[0] = $Password ;  NOT SURE HOW THIS WORKS, WAS TRYING DIFFERENT THINGS.

Global $oIE = _IECreate($Url, 1, 1, 0, 1) ;Open the URL with specified conditions
WinActivate("NetScaler Gateway") ;Activate the Window with the string "Netscaler Gateway" on the top left
WinWait("NetScaler Gateway") ;This will wait for the "Netscaler window" to be come alive
Sleep(10000) ;Sleeping as the time taken to load the CTX URL is long

WinWaitActive("NetScaler Gateway") ; This will wait for the "Netscaler Gateway" window to be activated to enter credentials as users might shift focus to different tasks while the page is loading.

Send($Username)
Sleep(1000)
Send("{TAB}")
Send($Password)
Sleep(1000)
Send("{TAB}")
Send("{ENTER}")


Appreciate your comments/suggestions.

 

Thanks

Share this post


Link to post
Share on other sites

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Why don't you enable "AlwaysOn" on the NetScaler Appliance or single sign-on?  Passing username/password would be a major security risk to your companies network.  Trying to make the script dynamic would also require the password being stored externally which is an additional risk.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...