Solved

VBscript to mask password when using Juniper nclauncher.exe

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

Title # Comments Views Activity
VPN doubts 4 79
Setting up new vpn 15 66
VBSScript Error IP Array 6 22
Review of a VPN cert policy 4 28
Juniper VPN devices are a popular alternative to using Cisco products. Last year I needed to set up an international site-to-site VPN over the Internet, but the client had high security requirements -- FIPS 140. What and Why of FIPS 140 Federa…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

773 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