简体   繁体   English

当您使用DirectoryEntry对象设置Web目录属性“ AuthNTLM”时,实际上要更改哪些IIS设置?

[英]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: 是否启用以下功能之一:

  • Integrated Windows Authentication 集成Windows身份验证
  • Digest Authentication 摘要式身份验证
  • Basic Authentication 基本认证
  • .NET Passport Authentication .NET Passport身份验证

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.

相关问题 如何在C#中使用DirectoryEntry删除IIS 6 Web目录属性 - How to remove IIS 6 web directory property using directoryentry in C# IIS 6.0 DirectoryEntry ScriptMaps属性并设置.Net版本 - IIS 6.0 DirectoryEntry ScriptMaps property and set .Net version 设置对象的DataSource属性时,何时使用类型与实例? - When setting the DataSource property of an object, when do you use a Type vs. an instance? 在设置属性之前检查null时,.net会加载属性 - .net loads property when you check for null before setting property 设置控件的属性时,可以在控件名称中使用字符串吗? - Can you use a string in the name of the control when setting its property? 如何使用Autofac向对象中注入任意/更改的服务集? - How do you inject an arbitrary/changing set of services into an object using Autofac? 当您在另一个变量中有名称时,如何设置 C# 4 动态 object 的属性 - How to set a property of a C# 4 dynamic object when you have the name in another variable 当您尝试将值设置为只读属性时会发生什么? - What happens when you try to set value to a read-only property? 在 C# .NET 中,当您知道对象的另一个属性时,如何访问该对象的另一个属性? - In C# .NET, how do you access a property of an object when you know another property of an object? 您需要一个带有构造函数的只读属性,让您为该属性设置值吗? - What do you need a read-only property with a constructor that let's you set the values in that property for?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM