I have a situation that is a Systems Admin nightmare. I have three separate domains, separate forests, that are connected through a site to site VPN.
Users in one office have to connect to shares on a server in another office, separate domain. They have user accounts in the remote domain. I'm scripting something that will prompt them for their password and map the drives. I want to know if it's possible to mask the input they type into the input box. I haven't found a way so far but thought to post the question. My code is at the bottom(it's a work in progress so no cracks about error trapping at the moment ). Thanks.
Code: Select all
'========================================================================== ' ' VBScript Source File -- Created with SAPIEN Technologies PrimalScript 2007 ' ' NAME: Map OC Bermuda drive. ' ' AUTHOR: Darrin Henshaw , Ignition Bermuda ' DATE : 1/24/2008 ' ' COMMENT: Created so that users can create mapped drives to OC BDA shares. ' '========================================================================== Option Explicit ' Initialize and create variables. Dim strUser, objNetwork, strPassword, strRemote, arrShares, arrDrives, strProfile, strDrive, strDrives, objDrives, i, strAnswer arrDrives = Array("T:","M:","V:") strRemote = "10.1.1.134" arrShares = Array("OCI_NY_BDA_data","Documents","Cash Reports") strProfile = "False" 'Create Network object, to get the local username, and to map the drive later on. Set objNetwork = CreateObject("WScript.Network") Set objDrives = objNetwork.EnumNetworkDrives For i = 0 to objDrives.Count - 1 Step 2 For Each strDrives In arrDrives If objDrives.Item(i) = strDrives Then objNetwork.RemoveNetworkDrive objDrives.Item(i) End If Next Next ' Get the local username, and append the Bermuda domain name to it. strUser = objNetwork.Username 'WScript.Echo strUser strUser = "olympiabda" & strUser strPassword = InputBox("Please input password for Bermuda account:") ' map the network drive to the correct server. i = 0 For Each strDrives In arrDrives objNetwork.MapNetworkDrive strDrives, strRemote & arrShares(i), strProfile, strUser, strPassword i = i + 1 Next ' Destroy variables from memory. Set objNetwork = Nothing