Results 1 to 6 of 6

Thread: Matthew Gates... Please help...

  1. #1

    Thread Starter
    Addicted Member eer3's Avatar
    Join Date
    Sep 2000
    Location
    Ca
    Posts
    165
    I read your post on wnetconnectiondialog1 and also a similar one on MSDN. Great stuff. Thanks!

    The drive map dialog is exactly what I needed, except that...

    how do you put some text in the "Connect as:" textbox on the dialog box??? (I'd like to have it put the Domain name\username in the box automatically)

    Can it be done??? If anyone were to know, I guessed it would be you.

    Thanks in advance

    p.s heres the MSDN article:
    http://support.microsoft.com/support.../Q177/6/98.asp

  2. #2
    Guest
    Couldn't you just make your own form and use this code and already have a letter in the textbox(es)?


    Code:
    Private Declare Function WNetAddConnection Lib "mpr.dll" Alias
    "WNetAddConnectionA" (ByVal lpszNetPath As String, ByVal lpszstrPassword As
    String, ByVal lpszLocalName As String) As Long
    
    
    Private Sub Command1_Click()
    
        Dim strLocalDriveLetter As String
        Dim strPassword As String
        Dim strNetworkPathName As String
    
        strLocalDriveLetter = "K:" 'Local drive letter to be mapped
        strPassword = "" 'specify network password if required
        strNetworkPathName = "\\NETWORKPATH\VOL1" 'path to network drive
    
        If WNetAddConnection(strNetworkPathName, _
        strPassword, strLocalDriveLetter) > 0 Then
            MsgBox ("An Error occurred mapping the drive")
        Else
            MsgBox ("Drive successfully mapped!")
        End If
    
    End Sub

  3. #3

    Thread Starter
    Addicted Member eer3's Avatar
    Join Date
    Sep 2000
    Location
    Ca
    Posts
    165

    Great Minds Think Alike!

    I had done that at first.

    The WNetAddConnection won't do it though, I had to use WNetAddConnection2, so that I could supply username and password.(I'm working on a NT platform across domains that are not trusted) When sending username with WNetAddConnection2, I just added "domainname\" to the username and all works well.

    But does this pose security issues, sending the password this way? It seems better to uses the Map Drive Dialog and let NT handle the security.

    Thanks for your response, any suggestions are greatly appreciated.

  4. #4
    Hyperactive Member barrk's Avatar
    Join Date
    Sep 2000
    Location
    My own little world
    Posts
    274

    Smile

    Just bringing this to the top again....as we still need more suggestions if anyone has any!

    Thanks in advance for your help!!!!

  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    I would have thought that the NT drive mapper would use this function, and as such depending on your settings would either send a clear or hashed password.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  6. #6

    Thread Starter
    Addicted Member eer3's Avatar
    Join Date
    Sep 2000
    Location
    Ca
    Posts
    165
    parksie,

    Yes, you are right.

    The problem is that the users are not on our domain. (for some idiotic security reason we cannot have trusted domains) When these remote users try to map a drive, it sends their local NT username/password, which don't exist on our domain. We need to authenticate the username/password that does exists on our domain.

    This all works fine in the Drive Map Dialog, as long as the user is smart enough put in ourdomain\username into the "Connect As:" section of the Drive Map Dialog box.

    So, the question is... Is there a way to populate the "Connect As:" text box of the Drive Map Dialog?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width