Virtual Directory (share on another machine)

  • Thread starter Me InCA via .NET 247
  • Start date
M

Me InCA via .NET 247

The following is the error I get on my Intranet site. IIS 5.0,.NET 1.0

Error Type: System.UnauthorizedAccessException
Error Message: Access to the path "\\FILESERVER101\Budget\BudgetBasics" is denied.
Stack Trace: at System.IO.__Error.WinIOError(Int32 errorCode,String str) atSystem.IO.Directory.InternalGetFileDirectoryNames(StringfullPath, Boolean file) atSystem.IO.DirectoryInfo.GetDirectories(String searchPattern) atSystem.IO.DirectoryInfo.GetDirectories()

I have a Virtual Directory called "Bulletins" pointing to a shareon another machine \\FILESERVER101\Budget.
The following is the code in the aspx.vb

Dim impersonationContext AsSystem.Security.Principal.WindowsImpersonationContext
Dim currentWindowsIdentity AsSystem.Security.Principal.WindowsIdentity

currentWindowsIdentity = CType(User.Identity,System.Security.Principal.WindowsIdentity)
impersonationContext =currentWindowsIdentity.Impersonate()

sPath = "Bulletins" & "\Budget Basics\"
'Server.MapPath (check in IIS)
dir = New DirectoryInfo(Server.MapPath(sPath))
'Get the sub directories
dirs = dir.GetDirectories()
dir.GetDirectories()
For Each subDir In dirs
....
....


Any help is appreciated.
 
J

Joe Kaplan \(MVP - ADSI\)

Your account probably isn't configured properly for Kerberos delegation, so
it cannot hop to a different machine. I would highly recommend Keith
Brown's .NET/Windows Security book and suggest you read some articles about
Kerberos Delegation:

http://www.microsoft.com/technet/prodtechnol/windowsserver2003/technologies/security/tkerberr.mspx

Joe K.

The following is the error I get on my Intranet site. IIS 5.0, .NET 1.0

Error Type: System.UnauthorizedAccessException
Error Message: Access to the path "\\FILESERVER101\Budget\Budget Basics" is
denied.
Stack Trace: at System.IO.__Error.WinIOError(Int32 errorCode, String str) at
System.IO.Directory.InternalGetFileDirectoryNames(String fullPath, Boolean
file) at System.IO.DirectoryInfo.GetDirectories(String searchPattern) at
System.IO.DirectoryInfo.GetDirectories()

I have a Virtual Directory called "Bulletins" pointing to a share on another
machine \\FILESERVER101\Budget.
The following is the code in the aspx.vb

Dim impersonationContext As
System.Security.Principal.WindowsImpersonationContext
Dim currentWindowsIdentity As
System.Security.Principal.WindowsIdentity

currentWindowsIdentity = CType(User.Identity,
System.Security.Principal.WindowsIdentity)
impersonationContext = currentWindowsIdentity.Impersonate()

sPath = "Bulletins" & "\Budget Basics\"
'Server.MapPath (check in IIS)
dir = New DirectoryInfo(Server.MapPath(sPath))
'Get the sub directories
dirs = dir.GetDirectories()
dir.GetDirectories()
For Each subDir In dirs
....
....


Any help is appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top