Re: Programmatically accessing individual file security configuration
From: David Miller (dmiller_at_crowechizek.com)
Date: 12/19/03
- Next message: Antonio Policelli: "Re: do i have to purchase an ssl?"
- Previous message: Jeff Cochran: "Re: do i have to purchase an ssl?"
- In reply to: Jerry III: "Re: Programmatically accessing individual file security configuration"
- Next in thread: Jerry III: "Re: Programmatically accessing individual file security configuration"
- Reply: Jerry III: "Re: Programmatically accessing individual file security configuration"
- Reply: David Wang [Msft]: "Re: Programmatically accessing individual file security configuration"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Fri, 19 Dec 2003 09:31:44 -0800
I should have been a bit more specific in my post. I'm
attempting to get this working using IIS 5.0 on a Win2k
machine. According to the documentation, I should be
able to use a IISWebFile ADSI object to get/set the
properties I need
(http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/iissdk/iis/ref_prog_iaorefiwf.asp).
However, the following C# code fails:
DirectoryEntry objIIS = new DirectoryEntry
("IIS://localhost/W3SVC/1/ROOT/autobase/leadnote.asmx");
String user = (string) objIIS.Properties
["AnonymousUserName"].Value;
Here, autobase is a virtual directory and leadnote.asmx
is the file I'm interested in. This code will fail on an
exception that the path cannot be found. If I remove the
file and reference only the virtual directory, the code
works fine. I am certain that the file exists.
Any ideas on why this is not working?
Dave
>-----Original Message-----
>What are you asking? There is a way to do this with
ADSI, WMI and even some
>other means (like changing the metabase yourself). The
fact that you're
>suggesting those seems to imply that you know how to use
them, so do it. The
>"key" is the path to the file, in a web context, such as
this:
>
>W3SVC/1/Root/vdir/leadnote.asmx
>
>Use your favorite technology to set metabase properties
you need.
>
>Jerry
>
>"David Miller" <dmiller@crowechizek.com> wrote in message
>news:fb6842a.0312181440.1085c7c1@posting.google.com...
>> I currently have a manual process as a part of an
install that I'm
>> trying to automate. Is there any way to do the
following to an
>> individual FILE within a virtual directory through
ADSI, WMI, or some
>> other means (ie. Win32 API's)?
>>
>> a. Run Start-Programs-Administrative Tools-Internet
Services Manager
>> b. Double click the server name to expand the server
web sites.
>> c. Double click the Default web site to expand it
>> d. Double click the virtual directory folder to expand
it.
>> e. In the right pane, right click leadnote.asmx
>> f. Click the file security tab.
>> g. In the Anonymous access and authentication control
section, click
>> the edit button
>> h. Check basic authentication. Make sure all other
options are
>> unchecked.
>> i. Click the OK button.
>> j. In the secure communications section, click the
Edit button.
>> k. Uncheck Require Secure Channel.
>> l. Click OK.
>> m. Click OK.
>> n. Close Internet Services Manager.
>>
>> Any help (especially sample code) would be GREATLY
appreaciated!
>>
>> Dave
>
>
>.
>
- Next message: Antonio Policelli: "Re: do i have to purchase an ssl?"
- Previous message: Jeff Cochran: "Re: do i have to purchase an ssl?"
- In reply to: Jerry III: "Re: Programmatically accessing individual file security configuration"
- Next in thread: Jerry III: "Re: Programmatically accessing individual file security configuration"
- Reply: Jerry III: "Re: Programmatically accessing individual file security configuration"
- Reply: David Wang [Msft]: "Re: Programmatically accessing individual file security configuration"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]