reiszj
asked on
Setting "AuthNTLM" property to virtual directory is not updated when using Directory Services
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("Synt ax").Value .ToString. ToUpper() = "BOOLEAN"
IISSchema.Dispose()
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
vDir.CommitChanges()
End If
Next
End If
Thanks for your help.
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("Synt
IISSchema.Dispose()
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"
vDir.CommitChanges()
End If
Next
End If
Thanks for your help.
ASKER
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad to help :-)
Not sure what's going in above statement