Board index » Web Programming » How to Enable Anonmous Access to a File under a Site

How to Enable Anonmous Access to a File under a Site

Web Programming282
Hi,

I need a help regarding configuring IIS programmatically using VB / VB

Script.

I have created a WebSite in IIS using VB and even enabled Windows

Authencation for that site.

But now, for a File and Folder alone, I want to enable the Anonymous

Access. I could not able to do that, I have tried many options.



This Exapmle scripts I got from Microsoft.com:

'Get a directory subordinate to the Web server root.

Set VDirObj = GetObject("IIS://MyComputer/W3SVC/1/Root/Vdir1/Dir1a")





'Overwrite the inherited value for write access

'by using the dot method equivalent to Put.

VDirObj.AccessWrite = True



'Save the changed value to the metabase.

VDirObj.SetInfo





I tried the same code in my scripts:



strFullVirtualDirectoryPath =

"IIS://localhost/W3SVC/3/Root/VPM/Menu.asp"



Set objWebFileOrFolder = GetObject(strFullVirtualDirectoryPath)





The object fails to create saying,

"Automation error

The system cannot find the path specified. "



The given path is right. I can able to create object till the Virtual

Directory, but not to its folder or any file inside Virtual Directory.



If any of you have any sample scripts or know how to do that pls help

me.



Thanks in Advance

Vivek







--

vikky_25

------------------------------------------------------------------------

Posted via www.webservertalk.com

------------------------------------------------------------------------

View this thread: www.webservertalk.com/message1039796.html


-
 

Re:How to Enable Anonmous Access to a File under a Site

Do you have a IIsWebFile named Menu.asp in the directory VPM (in the

Metabase)?





Please use Metabase Explorer and see if you have this. Because i dont

think you have.



http://www.microsoft.com/downloads/details.aspx?FamilyID" rel="nofollow" target="_blank">www.microsoft.com/downloads/details.aspx=56fc92ee-a71a-4c73-b628-ade629c89499&displaylang=en





--

Regards,

Kristofer Gafvert

www.gafvert.info - My Articles and help

www.ilopia.com





vikky_25 wrote:



Quote


Hi,

I need a help regarding configuring IIS programmatically using VB / VB

Script.

I have created a WebSite in IIS using VB and even enabled Windows

Authencation for that site.

But now, for a File and Folder alone, I want to enable the Anonymous

Access. I could not able to do that, I have tried many options.



This Exapmle scripts I got from Microsoft.com:

'Get a directory subordinate to the Web server root.

Set VDirObj = GetObject("IIS://MyComputer/W3SVC/1/Root/Vdir1/Dir1a")





'Overwrite the inherited value for write access

'by using the dot method equivalent to Put.

VDirObj.AccessWrite = True



'Save the changed value to the metabase.

VDirObj.SetInfo





I tried the same code in my scripts:



strFullVirtualDirectoryPath =

"IIS://localhost/W3SVC/3/Root/VPM/Menu.asp"



Set objWebFileOrFolder = GetObject(strFullVirtualDirectoryPath)





The object fails to create saying,

"Automation error

The system cannot find the path specified. "



The given path is right. I can able to create object till the Virtual

Directory, but not to its folder or any file inside Virtual Directory.



If any of you have any sample scripts or know how to do that pls help

me.



Thanks in Advance

Vivek







--

vikky_25

------------------------------------------------------------------------

Posted via www.webservertalk.com">www.webservertalk.com

------------------------------------------------------------------------

View this thread: www.webservertalk.com/message1039796.html">www.webservertalk.com/message1039796.html



-

Re:How to Enable Anonmous Access to a File under a Site

FYI: mixing anonymous and Windows authentication on the same site will not

work with IE.



The most obvious place that you see this is if you try to POST a FORM to the

anonymous URL after accessing a URL under Windows authentication -- it will

fail and the behavior is by-design.



IE thinks the website is authenticated, so on POST, it won't send the entity

because it expects it to be rejected by 401, but in reality, the anonymous

URL won't reject and hence accepts the POST with no entity. There is just no

good way to solve this problem because if you do, then an authenticated POST

with a 4GB content will end up sending 8GB of data.



--

//David

IIS

blogs.msdn.com/David.Wang">blogs.msdn.com/David.Wang

This posting is provided "AS IS" with no warranties, and confers no rights.

//

"vikky_25" <vikky_25.1o8p91@mail.webservertalk.com>wrote in message



Hi,

I need a help regarding configuring IIS programmatically using VB / VB

Script.

I have created a WebSite in IIS using VB and even enabled Windows

Authencation for that site.

But now, for a File and Folder alone, I want to enable the Anonymous

Access. I could not able to do that, I have tried many options.



This Exapmle scripts I got from Microsoft.com:

'Get a directory subordinate to the Web server root.

Set VDirObj = GetObject("IIS://MyComputer/W3SVC/1/Root/Vdir1/Dir1a")





'Overwrite the inherited value for write access

'by using the dot method equivalent to Put.

VDirObj.AccessWrite = True



'Save the changed value to the metabase.

VDirObj.SetInfo





I tried the same code in my scripts:



strFullVirtualDirectoryPath =

"IIS://localhost/W3SVC/3/Root/VPM/Menu.asp"



Set objWebFileOrFolder = GetObject(strFullVirtualDirectoryPath)





The object fails to create saying,

"Automation error

The system cannot find the path specified. "



The given path is right. I can able to create object till the Virtual

Directory, but not to its folder or any file inside Virtual Directory.



If any of you have any sample scripts or know how to do that pls help

me.



Thanks in Advance

Vivek







--

vikky_25

------------------------------------------------------------------------

Posted via www.webservertalk.com">www.webservertalk.com

------------------------------------------------------------------------

View this thread: www.webservertalk.com/message1039796.html">www.webservertalk.com/message1039796.html





-