在IIS 6中的应用程序级别设置NTAuthenticationProviders [英] Setting NTAuthenticationProviders at an Application level in IIS 6

查看:182
本文介绍了在IIS 6中的应用程序级别设置NTAuthenticationProviders的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在IIS中有以下结构。

I have the following structure in IIS.

Internet Information Services  
 (local computer)
  Web Sites  
   Default Web Site  
    MyApplication

MyApplication 是IIS中的应用程序。

MyApplication is a Application in IIS.

默认网站上未设置集成Windows身份验证
但是我想在 MyApplication 上设置集成Windows身份验证。 (它是一个内联网应用程序)。

Integrated Windows authentication is NOT set on the Default Web Site. However I want to set Integrated Windows authentication on MyApplication. (Its an intranet app).

这可以通过GUI完成:右键单击默认网站并选择属性。选择目录安全性选项卡,然后单击匿名访问和身份验证控件上的编辑

This can be done via the GUI: Right click on the Default Web Site and choose Properties. Select the Directory Security tab, and click Edit on the Anonymous access and authentication control.

我想在安装脚本中包含它。我有其他设置命令,使用 adsutil.vbs ,但我很难设置集成Windows身份验证。

I want to include this in a setup script. I have other setup commands, using adsutil.vbs but I'm struggling to set up the Integrated windows authentication.

正在运行:


cscript // nologo c:\ Inetpub \AdminScripts\adsutil.vbs GET / W3SVC / 1 / NTAuthenticationProviders

cscript //nologo c:\Inetpub\AdminScripts\adsutil.vbs GET /W3SVC/1/NTAuthenticationProviders

返回

NTAuthenticationProviders       : (STRING) "NTLM"

然而,我已经完成了能够运行

However, i exepcted to be able to run


cscript // nologo c:\ Inetpub \AdminScripts\adsutil.vbs GET / W3SVC / 1 / ROOT / MyApplication / NTAuthenticationProviders

cscript //nologo c:\Inetpub\AdminScripts\adsutil.vbs GET /W3SVC/1/ROOT/MyApplication/NTAuthenticationProviders

但是这会返回

Error Trying To GET the property: (Get Method Failed)
NTAuthenticationProviders (This property is probably not allowed at this node)

是否无法在一个 NTAuthenticationProviders 上设置元数据库属性n应用级别?

Is it not possible to set NTAuthenticationProviders Metabase property on an appliction level?

推荐答案

控制IIS目录安全性 - >身份验证方法对话框上的Authenticated Access属性值的配置数据库属性是实际上叫做 AuthFlags

The metabase property that controls the Authenticated Access property values on the IIS Directory Security -> Authentication Methods dialogue is actually called AuthFlags.

这个值是一个标志,记录在这里:

The value is a flag and is documented here:


AuthFlags Metabase Property(IIS 6.0)(TechNet)

To将此值设置为集成Windows身份验证( AuthNTLM )使用以下命令(注意,因为此命令在默认网站上运行,IISNumber:1 ) -

To set this value to Integrated Windows Authentication (AuthNTLM) use the following command (take care because this command operates on the Default Website, IISNumber:1) -


adsutil.vbs SET / W3SVC / 1 / ROOT / MyApplication / AuthFlags 4

如果你想设置NTLM和Basic正品然后你可以将值一起布尔或值,例如 MD_AUTH_BASIC | AuthNTLM 。这将产生 6的整数结果

If you want to set, say, both NTLM and Basic authentication then you would boolean OR the values together, e.g. MD_AUTH_BASIC | AuthNTLM. This would product an integer result of 6:


::设置NTLM和基本身份验证

adsutil.vbs SET / W3SVC / 1 / ROOT / MyApplication / AuthFlags 6

如果检查配置数据库文件( C:\ WINDOWS \ system32 \inetsrv \ MetaBase .xml )并搜索:

If you inspect the metabase file (C:\WINDOWS\system32\inetsrv\MetaBase.xml) and search for:


Location =/ LM / W3SVC / 1 / ROOT / MyApplication

...您将看到控制此设置的属性(之后)如上设置为6):

...you will see the attribute that controls this setting (after setting to 6 as above):


AuthFlags =AuthBasic | AuthNTLM

在元数据库中更新此值可能需要一些时间,因为此类更改不会立即刷新到文件中(尽管IISRESET会使它立即更新)。

It may take some time before this value updates in the metabase because changes such as this aren't immediately flushed to the file (although IISRESET will cause it to update immediately).

这篇关于在IIS 6中的应用程序级别设置NTAuthenticationProviders的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆