[英]When you set a web directory property “AuthNTLM” using the DirectoryEntry object, what IIS setting are you actually changing?
I'm in task of migrating our product's installer from InstallShield to WiX. 我的任务是将我们的产品安装程序从InstallShield迁移到WiX。
To deploy web applications, the previous developers used Custom Actions (written in C#) in InstallShield. 为了部署Web应用程序,以前的开发人员在InstallShield中使用了“自定义操作”(用C#编写)。 In Wix, this is no longer necessary because wix supports IIS deployment.
在Wix中,这不再是必需的,因为wix支持IIS部署。
Anyway, one of the code in the Custom Action uses the DirectoryEntry object to set the property of a Web Directory: 无论如何,“定制操作”中的代码之一使用DirectoryEntry对象来设置Web目录的属性:
DirectoryEntry.Properties["AuthNTLM"][0] = true;
What does this setting do? 此设置有什么作用? I know it has something to do with security/permission, but what setting does it actually set in IIS?
我知道它与安全性/权限有关,但是它实际上在IIS中设置了什么设置? Does it enable one of the following:
是否启用以下功能之一:
Thanks! 谢谢!
A while back I provided an answer to a similar question: 前一段时间,我提供了一个类似问题的答案:
Setting NTAuthenticationProviders at an Application level in IIS 6
在IIS 6中的应用程序级别设置NTAuthenticationProviders
AuthFlags
(not AuthNTLM
) is a flag value. AuthFlags
(不是AuthNTLM
)是一个标志值。 You can set this without using an indexer, for example: 您可以在不使用索引器的情况下进行设置,例如:
int MD_AUTH_ANONYMOUS = 1;
int MD_AUTH_BASIC = 2;
int MD_AUTH_NT = 4;
using(DirectoryEntry w3svc = new DirectoryEntry(@"IIS://Localhost/W3SVC"))
{
using(DirectoryEntry webSite = w3svc.Children.Add(iisNumber, "IIsWebServer"))
{
// Configure website settings here...
....
webSite.CommitChanges();
using(DirectoryEntry siteRoot = webSite.Children.Add("root",
IISSchemaClasses.IIsWebVirtualDir))
{
// Configure root application settings...
....
// Only allow Basic and NTLM authentication
siteRoot.Properties["AuthFlags"].Value = MD_AUTH_BASIC | MD_AUTH_NT
siteRoot.CommitChanges();
}
}
}
Actually it probably wasn't needed in InstallShield either. 实际上,在InstallShield中也可能不需要它。 Currently, InstallShield actually has better built-in IIS support then WiX and this type of setting can be done declaratively without writing a custom action.
当前,InstallShield实际上比WiX具有更好的内置IIS支持,并且可以以声明方式完成这种类型的设置,而无需编写自定义操作。 Also the InstallShield UI that collects this information looks pretty much just like the IIS MMC Snap-In so that it's intuitive how the data maps.
同样,收集此信息的InstallShield UI看起来与IIS MMC管理单元非常相似,因此可以直观地看到数据的映射方式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.