Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where are the settings stored
Message
 
To
09/01/2006 16:18:37
General information
Forum:
Internet
Category:
Security
Miscellaneous
Thread ID:
01084950
Message ID:
01084990
Views:
8
>Hi all,
>
>I am attempt to create an automated tests to validate our companys security module of the out application. The application is writen in ASP.NAT, and uses either the Integrated Windows Authentication (via IIS) or a home grown login screen.
>
>The question I have is, I have toggle the "Integrated Windows Authentication" checkbox in IIS to turn ir on and off. It is found in the Property dialog for erach of the sites in the IIS manager. I would like to do this via script. Does anyone know where these setting for each site are stored? I it stored in the registry? is there a special setting file, and ca it be altered from out IIS manager?
>
>Thanks in advance
Greg,

Take a look at:
http://www.aspfree.com/c/menu/Using-ADSI-to-set-Default-WebSite-web-security-permissions

You will have to enumerate the websites on the server to decided which one to play with (usually the enumeration comes along on the IIS admin console).

Here is another sample (adding a website):
Const ADS_PROPERTY_UPDATE = 2
Const POOLED = &h2
Const MD_AUTH_ANONYMOUS = &h1
Const MD_AUTH_NT = &h4
Const SITE_STARTED = &h2

Set objIIsWebService = GetObject("IIS://localhost/W3SVC")

intCount = 0
For Each Site in objIIsWebService
  If Site.Class = "IIsWebServer" Then _
   intCount = 1 + intCount
Next
intWebServerIndex = intCount + 1

Set objIIsWebServer = _
 objIIsWebService.Create("IIsWebServer", intWebServerIndex)

objIIsWebServer.Put "ServerComment", "NewSite"
strEntry = Array(":7000:")
objIIsWebServer.PutEx ADS_PROPERTY_UPDATE, "ServerBindings", strEntry
objIIsWebServer.SetInfo
WScript.echo objIIsWebServer.ADsPath & " created."

Set objIIsVirtualDir = objIIsWebServer.Create("IIsWebVirtualDir", "ROOT")
objIIsVirtualDir.Put "Path", "d:\inetpub\vdirRoot"
objIIsVirtualDir.Put "AccessRead", TRUE
objIIsVirtualDir.Put "AccessScript", TRUE
objIISVirtualDir.Put "AuthFlags", MD_AUTH_ANONYMOUS + MD_AUTH_NT
objIIsVirtualDir.Put "AppFriendlyName", "Default Application"
objIIsVirtualDir.AppCreate2 POOLED
objIIsVirtualDir.SetInfo
WScript.echo objIIsVirtualDir.ADsPath & " created."

WScript.Echo "Starting the " & _
 objIIsWebServer.Get("ServerComment") & " Web server"

objIIsWebServer.Start

intStatus = objIISWebServer.Status
If intStatus = SITE_STARTED Then
  WScript.Echo "Web server started."
Else
  WScript.Echo "The Web server did not start."
End If
Cheers,
Ricardo A. Parodi
eSolar, Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform