[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 362
  • Last Modified:

VBScript - NT Authentication Script

I didn't see topic that covered VBScript specifically so hopefully you all can help me here.

This is the situation:  I have Windows 2000 Professional clients on a Windows Server 2003 domain and would like to create a script that will map drives to a server in a Windows NT 4.0 domain.  

The first script I wrote says that "access is denied."  I need to add to the script the ability to enter the NT domain's User Name and Password.

Notes: There is no trust between the domains and the Usernames are different between domains for the same person (bob's username in NT = admin2, bob's username in 2003 = bsmith).

If anyone can help, I would greatly appreciate it.
  • 2
1 Solution
acksisAuthor Commented:
Another note - we've considered adding the trust between domains but that would also include adding the 2003 user groups to the NTFS permissions on the old domain.  That sounded like considerably more work and decided against it.
David LeeCommented:
If "... the ability to enter the NT domain's User Name and Password" means you want the user to be prompted for a username and password, then the script below will do that.

    Dim objNetwork, strLetter, strRemoteShare, strUserName, strPassword
    strLetter = "Z:"
    strRemoteShare = "\\Server\Share"
    strUserName = InputBox("Enter your username", "Username")
    strPassword = InputBox("Enter the password for " & strUserName, "Password")
    Set objNetwork = CreateObject("Wscript.Network")
    objNetwork.MapNetworkDrive strLetter, strRemoteShare, , strUserName, strPassword
    Set objNetwork = Nothing
acksisAuthor Commented:
that works - thanks

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now