ADSI and DirectoryServices Security issue
From: Marcus Müller (marcusmueller_at_gmx.de)
Date: 06/30/03
- Next message: Amol Shambharker: "Re: web config problem!!!!"
- Previous message: Ernie: "Necessary Permissions?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Mon, 30 Jun 2003 15:13:02 +0200
Hi,
I have a problem using DirectoryServices (ADSI) with ASP.DOT.
The following function returns the mime description of a file extension (a
reference to the "Active DS Type Library" COM object is required):
using System.DirectoryServices;
using System.IO;
private string MimeType(string sFile)
{
string sExtension = Path.GetExtension(sFile);
DirectoryEntry cMimeMap = new DirectoryEntry("IIS://LocalHost/MimeMap");
object[] arMimeMap = (object[])cMimeMap.Invoke("GetEx", "MimeMap");
foreach(IISOle.IISMimeType cMimeType in arMimeMap)
if(cMimeType.Extension == sExtension)
return cMimeType.MimeType;
return "application/octet-stream";
}
I was only able to get access to the mime map if <identity
impersonate='true'/> was set in the web.config file and IUSR_MACHINE was a
member of the administrator group. These securtiy settings are quite unsafe
and not applicable for a production system.
Hence, does anybody have a solution how to access ADSI without changing the
IIS account security settings or, even better, how to access the IIS mime
map without ADSI ?
Many thanks in advance.
Marcus
- Next message: Amol Shambharker: "Re: web config problem!!!!"
- Previous message: Ernie: "Necessary Permissions?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|