Jump to content

Adding Authentication to Script


Recommended Posts

I have a script already that prompts for a username and password and then maps drives and creates shortcuts on the desktop. It works perfectly except for one thing. I'd like to make it so that there's an authentication before it creates anything. If the username and password are fine, then it maps the drives. If the username and password are incorrect, then it tells the user this information before doing anything else.

Currently, if users input the wrong username and/or password, the shortcuts are created but they point to nothing (since the drive mapping failed). The script itself acts like nothing is wrong. I just want to make sure that none of this happens if users can't authenticate.

Link to comment
Share on other sites

No problem. Where do you want to read the user+pwd info from ? hardcoded in your script? A file somewhere on a share?

After that, just use something like

If $theStufftheuserinpput (maybe with GuiCtrlRead($yourControl) = $theValueToMatch Then ...

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

You can use the Active Directory UDF (for download please see my signature) to do some checking against AD.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...