Re: Drive mappings and access to domain directories under IIS
From: Barry Jacobs (a_at_a.com)
Date: 08/02/04
- Previous message: newsreader: "Re: Drive mappings and access to domain directories under IIS"
- In reply to: newsreader: "Re: Drive mappings and access to domain directories under IIS"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 2 Aug 2004 14:59:37 +0100
Finally found a solution for this, there is an sdk call that simulates net
use ...
Private Declare Function WNetAddConnection2 Lib "mpr.dll" Alias
"WNetAddConnection2A" _
(lpNetResource As NetResource, ByVal lpPassword As String, ByVal lpUsername
As String, _
ByVal dwFlags As Long) As Long
Private Declare Function WNetCancelConnection2 Lib "mpr.dll" _
Alias "WNetCancelConnection2A" (ByVal lpName As String, ByVal dwFlags As
Long, _
ByVal fForce As Long) As Long
Private Const NO_ERROR = 0
Private Const CONNECT_UPDATE_PROFILE = &H1
Private Const RESOURCETYPE_DISK = &H1
Private Type NetResource
dwScope As Long
dwType As Long
dwDisplayType As Long
dwUsage As Long
lpLocalName As String
lpRemoteName As String
lpComment As String
lpProvider As String
End Type
....
Dim NetworkMap As NetResource
Dim Result as Long
NetworkMap.dwType = RESOURCETYPE_DISK
NetworkMap.lpRemoteName = "\\<server>\<share>"
NetworkMap.lpLocalName = Chr(0)
Result = WNetAddConnection2(NetworkMap, "<password>",
"<domain>\<user>", CONNECT_UPDATE_PROFILE)
If (Result = NO_ERROR) Then
... Access file via UNC \\<server>\<share>\<filepath>
Result = WNetCancelConnection2(NetworkMap.lpRemoteName, 0, 0)
end if
....
"newsreader" <mfleyda@No_Spam.e-one.com> wrote in message
news:exqNMEJeEHA.1000@TK2MSFTNGP12.phx.gbl...
> I had the a similar problem accessing shares on our local domain... I
> found that IIS can only talk with local drives on the box, so unless you
map
> the drive on that computer, you are SOL.
>
>
> newsreader
>
>
> "Barry Jacobs" <a@a.com> wrote in message
> news:#RndxYHeEHA.3124@TK2MSFTNGP09.phx.gbl...
> > I have a problem with accessing file resources, running VB6 code under
IIS
> > 5.0. We have two Domains A and B and a UNC file share on Domain B
> > (\\B\Directory) having access set to everyone.
> >
> > Our IIS session runs under an account on Domain A and some files are
> present
> > on domain B. Domain A cannot have any trust relationship with Domain B
(no
> > idea if that makes a difference!). Through explorer I can connect to the
> > files on Domain B with a Domain B account but neither the UNC
> \\B\Directory
> > or any mapped drives are available to my code running under IIS.
> >
> > So far tried the following:
> >
> > 1) Using LogonUser with the domain B account details.
> >
> > 2) Running a shell with a net use to \\B\Directory before file access.
> >
> > 3) Running a shell with a net use to \\B\Directory spawned with a
> > CreateProcessWithLogon, after impersonating a domain A account set up on
> the
> > host IIS machine.
> >
> > None of these work and to be honest I'm really fishing in the dark. Does
> > anyone have any ideas?
> >
> >
> > Thanks in advance.
> >
> > Barry Jacobs
> >
> >
>
>
- Previous message: newsreader: "Re: Drive mappings and access to domain directories under IIS"
- In reply to: newsreader: "Re: Drive mappings and access to domain directories under IIS"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|