Solved

VBscript to mask password when using Juniper nclauncher.exe

Posted on 2011-09-20
5
875 Views
Last Modified: 2012-05-12
Hi,

Im looking for a VBscript that masks password to be used with Junipers nclauncher.exe.
Till now I have a batch file that pickes up the user name, then the realm url etc. using nclauncher.exe.
The password is empty so user need to type it in, but the problem is thats in clear text and that is not good.
I was hoping to use a VBscript that promts the user to type the password, but masks it, then use it in the nclauncher.exe filed Password:

nclauncher [-url Url] [-u username] [-p password] [-r realm]

Hope this is possible or if there is an other solution even better?

fjebja
0
Comment
Question by:Bjarte Fjelland
  • 3
  • 2
5 Comments
 
LVL 65

Expert Comment

by:RobSampson
ID: 36570415
Hi, perhaps something like this would work?

Run it with
cscript RunNCLauncher.vbs

We could could make the more static parameters get passed as arguments to the script if you wanted to.

Regards,

Rob.
Set objPassword = CreateObject("ScriptPW.Password") 

WScript.StdOut.Write "Enter your URL: "
strURL = WScript.StdIn.ReadLine
WScript.StdOut.Write "Enter your username: "
strUsername = WScript.StdIn.ReadLine
WScript.StdOut.Write "Please enter your password: "
strPassword = objPassword.GetPassword() 
WScript.StdOut.Write "Enter your realm: "
strRealm = WScript.StdIn.ReadLine

strCommand = "nclauncher -url " strUrl & " -u " & strUsername & " -p " & strPassword & " -r " & strRealm
Set objShell = CreateObject("WScript.Shell")
objShell.Run strCommand, 1, False

Open in new window

0
 
LVL 1

Author Comment

by:Bjarte Fjelland
ID: 36576388
Hi Rob,

Great and thank you, thats what Im looking for.
I just added '&' after -url "
strCommand = "nclauncher -url " & strUrl & " -u " & strUsername & " -p " & strPassword & " -r " & strRealm

Is it possible to only use users password?
put the URL in the script, same with realm, fetch the username from windows.

Hope Im not asking to mutch?
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 36577275
OK, that's easy.  We just change the parameters at the top to be hardcoded instead of input boxes.

Rob.
Set objPassword = CreateObject("ScriptPW.Password") 
Set objNetwork = CreateObject("WScript.Network")

strURL = "http://10.0.0.1"
strUsername = objNetwork.UserName
WScript.StdOut.Write "Please enter your password: "
strPassword = objPassword.GetPassword() 
strRealm = "yourealm"

strCommand = "nclauncher -url " & strUrl & " -u " & strUsername & " -p " & strPassword & " -r " & strRealm
Set objShell = CreateObject("WScript.Shell")
objShell.Run strCommand, 1, False

Open in new window

0
 
LVL 1

Author Closing Comment

by:Bjarte Fjelland
ID: 36583158
Yes, thats it!
Thank you so much!
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 36583936
No problem.

Rob.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
How to set-up an On Demand, IPSec, Site to SIte, VPN from a Draytek Vigor Router to a Cyberoam UTM Appliance. A concise guide to the settings required on both devices
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now