Setting "AuthNTLM" property to virtual directory is not updated when using Directory Services

Posted on 2010-03-29
Medium Priority
Last Modified: 2013-11-26
I am trying to set authentication for the virtual directory to use windows authentication.  It doesn't matter what value (i.e. True or False) I assign to vDir.Properties("AuthNTLM").Item(0) it doesn't seem to take and defaults to inheriting the settings from the site.  

Any ideas on overriding the inherited authentication for the site?

Here is my code:

Dim IISSchema As New DirectoryEntry("IIS://" & webSite & "/Schema/AppIsolated")
        Dim canUpdate As Boolean = Not IISSchema.Properties("Syntax").Value.ToString.ToUpper() = "BOOLEAN"
        Dim IISAdmin As New DirectoryEntry("IIS://" & webSite & "/W3SVC/1/Root")

        If canUpdate Then
            For Each vDir As DirectoryEntry In IISAdmin.Children
                If vDir.Name = appName Then
                   vDir.Properties("AuthNTLM").Item(0) = True
                End If
        End If

Thanks for your help.
Question by:reiszj
  • 3
  • 2
LVL 83

Expert Comment

ID: 29004601
>Dim canUpdate As Boolean = Not IISSchema.Properties("Syntax").Value.ToString.ToUpper() = "BOOLEAN"

Not sure what's going in above statement

Author Comment

ID: 29008986
CodeCruiser thanks for your fast reply, but removing the check if IIS is running under Windows NT didn't fix the issue.  I commented out the top 3 lines and the if statement for canUpdate and I got the same result that authentication is not being changed.
LVL 83

Expert Comment

ID: 29009776

Accepted Solution

reiszj earned 0 total points
ID: 29484794
I was able to solve the problem by setting vDir.Properties("AuthAnonymous").Item(0) = False as well.

CodeCruiser thank you for your many suggestions.
LVL 83

Expert Comment

ID: 29484957
Glad to help :-)

Featured Post

7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Free Data Recovery software is an advanced solution from Kernel Tools to recover data and files such as documents, emails, database, media and pictures, etc. It supports recovery from physical & logical drive after a hard disk crash, accidental/inte…
From store locators to asset tracking and route optimization, learn how leading companies are using Google Maps APIs throughout the customer journey to increase checkout conversions, boost user engagement, and optimize order fulfillment. Powered …

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question