Jump to content
Sign in to follow this  
MooglePower

Adding Authentication to Script

Recommended Posts

MooglePower

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.

Share this post


Link to post
Share on other sites
Xenobiologist

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

Share this post


Link to post
Share on other sites
MooglePower

Ah, I was meaning to authenticate against our network using Active Directory, although I think I figured out a way to do it. Thanks for your help!

Share this post


Link to post
Share on other sites
water

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.