English 中文(简体)
• 如何将认证方法纳入综合统计方案
原标题:How to set Authentication Methods in IIS programmatically

我们正在努力使某些国际独立实体应用程序的部署自动化。 I ve used cscript. 在窗户档案中挖掘,以制作网络数据。 然而,目前我需要实现自动化的少数环境。 换言之,如果你看一看一台机器的特性,在名录结构下——> Authentication and access control -> Edit,我需要不检查可匿名的存取,并检查综合视窗认证。

是否很容易从窗户档案中做到这一点?

EDIT:我应该澄清的是6号国际数据,因此无法提供。

最佳回答

我回答了一个非常相似的问题,但又回过来。 举例使用<代码>已使用。 您能够从您档案中找到的工具:

IS 6 (Stack Overflow)中申请级别的供应商

<>上>

由于您已经收到网站C. 的文字,你只能将列入文字:

   Some values just as an example
iisNumber = 668
ipAddress = "172.16.3.200"
hostName = "myserver.com"
wwwfolder = "c:mysiteswww"


Dim serverBindings(1)
serverBindings(0) = ipAddress & ":80:www." & hostName
serverBindings(1) = ipAddress & ":80:" & hostName


   Create server
Set w3svc = GetObject("IIS://localhost/w3svc")
Set newWebServer = w3svc.Create("IIsWebServer", iisNumber)
newWebServer.ServerBindings = serverBindings
newWebServer.ServerComment = "Server is: " & hostName
newWebServer.SetInfo

   Create /root app
Set rootApp = newWebServer.Create("IIsWebVirtualDir", "ROOT")
rootApp.Path = wwwFolder
rootApp.AccessRead = true
rootApp.AccessScript = true
rootApp.AppCreate(True)
rootApp.AuthFlags = 4    <== Set AuthFlags here
rootApp.SetInfo
问题回答

ConfigureWindows Authentication (IIS 7):

appcmd set config /section:windowsAuthentication /enabled:true | false

对IIS 6来说,也许WMI是另一种选择:

Dim sSitePath = "1"  Set the site ID here
Set oSite =  GetObject("IIS://localhost/" & sSitePath & "/root")

Select Case oSite.AuthFlags
  Case 1
    Wscript.Echo "Anonymous"
  Case 2
    Wscript.Echo "Basic"
  Case 4
    Wscript.Echo "NTLM"
  Case 6
    Wscript.Echo "MD5"
  Case 64
    Wscript.Echo "Passport"
End Select




相关问题
Session Management with Windows Authentication

In an ASP.NET web app, using Integrated Windows Authentication, is the session tied to the windows identity? In other words, if I login (using IWA) to the app, and the app stores some "stuff" in my ...

Using Elmah with Cassini

Does anyone know if I can use Elmah with Visual Studio build-in web server(aka Cassini)? I get it working easily on IIS, but using same configuration, it doesn t work with Cassini. When I requested ...

Setting hostname in IIS, include www?

I want to set the hostname for a website I m adding in IIS 7, however do I include the www in the hostname or not? because I want both www.mysite.com and mysite.com both to point to mysite on the ...

inetpub versus any other folder

I ve run websites out of inetpub, as well as from folders just residing on the C: drive. I wonder, are there any definitive advantages to running websites out of inetputwwwroot?

IIS 6.0 hangs when serving a web-service

I am having issues with one of our web-services. It works fine on my development machine (win XP) whether I host it as a separate application or using cassini from Visual studio. Once I deploy on the ...

热门标签