script that asks user for credentials and maps drive
I need to build a script that will prompt a login credentials that are different to their windows credentials.
if the login is correct, it maps the I drive to a Unix Server
there is a net use command file used at the moment that maps the drive to a generic user account but I need it to map to specific user accounts?
so far, using different scripts online, I have managed to come up with the following.
Dim objNetwork, objShell
Dim strDriveLetter, strRemotePath, strUserName, strPas
strDriveLetter = "I:"
strRemotePath = "\\Blah\%HOME%\"
' Purpose of the script to create a network object. (objNetwork)
' Then to apply the MapNetworkDrive method. Result I: drive
Set objNetwork = WScript.CreateObject("WScript.Network")
' Here is where we extract the UserName
strUserName = InputBox("CIMS username ")
strPas = InputBox("CIMS password ")
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath & strUserName & StrPas
' Bonus code to open Explorer at the mapped drive letter
Set objShell = CreateObject("WScript.Shell")
I do not really have any VBS knowledge - its more trial an error on my part for the moment
when I run the above script, I am asked for username and password which is good but I then get an error.
Error: the specified network password is not correct
any help would be great
8/22/2022 - Mon
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!