I get a COMException "Access Deined" when I try to connect to a remote IIS 6 server from my C # application that runs on IIS 5.1.
Any ideas? I am experiencing the same problems with the original questions.
Update - 4/1/09
I found this solution ( http://www.codeproject.com/KB/cs/Start_Stop_IIS_Website.aspx ), which consists of a windowed application connecting to the IIS server to start and stop websites. I can run it on my workstation and connect to the IIS server.
Ugh .... why can I run this standalone application, but not my ASP.NET application?
Original
I get a “Access Denied” COMException when I try to connect to IIS from a remote machine using the DirectoryEntry.Exist method to check if the IIS server is valid.
string path = string.Format("IIS://{0}/W3SVC", server);
if(DirectoryEntry.Exist(path))
{
}
I am a member of the Active Directory group that has been added to the Administrators group on the IIS server I'm trying to connect to.
Does anyone experience this problem and know how to solve it?
UPDATE:
@Kev is an ASP.NET application. In addition, I can connect without a username and password to the remote server through IIS6 Manager.
@Chris. I am trying to connect to a remote server to display the number of virtual directories and determine the version of the .NET platform for each directory. See this question .
@dautzenb - ASP.NET IIS 5.1, IIS 6. ASPNET . , .
2:
@Kev - DirectoryEntry, :
public DirectoryEntry
(
string path,
string username,
string password
)
" " System.Runtime.InteropServices.COMException ", .
, AuthenticationType Secure.
3:
IIS , :
:
:
: 680
: MICROSOFT_AUTHENTICATION_PACKAGE_V1_0
: ASPNET
:
: 0xC0000234
:
: /
: 529
:
:
: ASPNET
: (MyDomain)
: 3
: NtLmSsp
: NTLM
: (MyWorkstationId)
Caller : -
Caller Domain: -
Caller Logon ID: -
Caller Process ID: -
: -
: 10.12.13.35
: 1708
true, . ASPNET IIS.