If a drive is already mapped, then open Windows Explorer



I'm a newbie to VBScripting, so hopefully this will make sense. We
have users that will be connecting to a Terminal Server in order to
map a network drive to a share that exists in a different domain then
they are already authenicated to. The Terminal server is really
locked down, so they can't even open Windows Explorer and select "Map
Network Drive" and "Log on as different user". I wrote a script that
will automatically set the domain name and then prompt the user for a
username and password. After the user authenticates, the script will
open Windows Explorer to the drive they mapped. This part is working
exactly as I want. The problem is I want to be able to see if the
drive is already mapped, and if so, open Windows Explorer. If not, it
would then go ahead and prompt the user for username and password. I
started messing around with If Then Else statements, but so far no
luck. Any suggestions would be greatly appreciated. Thanks!!!


strRemoteDomain = "Remote Domain Name"
Set objNetwork = Wscript.CreateObject ("Wscript.Network")
strUserName = InputBox("Please Enter Your UserName:", "UserName
prompt")
strRemoteUserName = strRemoteDomain & "\" & strUserName
strPassword = InputBox("Please Enter Your Password:", "Password
prompt", "<password>")
objNetwork.MapNetworkDrive "M:", "\\Server\Share", FALSE,
strUserName, strPassword
Set objExplorer = WScript.CreateObject("InternetExplorer.Application")
objExplorer.Navigate "M:"
objExplorer.ToolBar = 1
objExplorer.StatusBar = 1
objExplorer.Width=800
objExplorer.Height = 600
objExplorer.Left = 0
objExplorer.Top = 0
objExplorer.Visible = 1
wscript.quit

.



Relevant Pages

  • RE: Full Security - mapping shared printer...
    ... Microsoft Global Technical Support Center ... Full Security - mapping shared printer... ... | to a terminal server thing. ... | map the same printer without issue. ...
    (microsoft.public.windows.terminal_services)
  • Re: ISA prompts for credentials for intranet ONLY in Terminal Services
    ... From your description this does not seem to be a Terminal Server issue ... Am I correct that the accounts ... then the prompt is normal because in your ISA you ... "Internet Users" group, whose membership does not include the TS accounts. ...
    (microsoft.public.isa)
  • Re: Where is the Map Root checkbox for Terminal Server Home Direct
    ... In the later versions net use will map deeper. ... Microsoft MVP - Terminal Server ... Kevin Hurni wrote: ... "Jeff Pitsch" wrote: ...
    (microsoft.public.windows.terminal_services)
  • Re: Domain Logon cant change password
    ... > MCSE, CCEA, Microsoft MVP - Terminal Server ... >> I have a user who does a domain logon onto our W2K domain. ... >> If she logs onto our Citrix server and gets the prompt, ... >> on the local workstation? ...
    (microsoft.public.windows.terminal_services)
  • Re: Full Security - mapping shared printer...
    ... All I had to do was login as a member of the ... This left the drivers on the terminal server and then I ... could login as a non-Administrator and map any printer that had been ... but keep the driver. ...
    (microsoft.public.windows.terminal_services)