Solved

VBscript to mask password when using Juniper nclauncher.exe

Posted on 2011-09-20
5
891 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

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

Suggested Solutions

Some of you may have heard that SonicWALL has finally released an app for iOS devices giving us long awaited connectivity for our iPhone's, iPod's, and iPad's. This guide is just a quick rundown on how to get up and running quickly using the app. …
OpenVPN is a great open source VPN server that is capable of providing quick and easy VPN access to your network on the cheap.  By default the software is configured to allow open access to your network.  But what if you want to restrict users to on…
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…

821 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