iis 6 - Get IIS Web Site identifier programmatically -


I am trying to use the app in the installation script of a web app that sets the IIS 6.0 Being installed on. Works as the following command:

  adsutil.vbs set w3svc / 1 / root / authflags 4  

This is the command for the default web site , Its identifier is 1. However, new web applications have been given a generated identifier. In my case, the app installed by me was given the identifier of 2082238887, so my order should look like this

  adsutil.vbs set w3svc / 2082238887 / root / authflags 4  

However, I only know this value before app install. How do I get this ID during a fresh installation? I have seen every example that you are working with the default web site for ads, and therefore have an ID of 1.

Set up permissions through the Adsutil to install the app, get its identifier.

This script allows you to provide and repeat the site name as a parameter on the Web when It does not match the site name you provided. I included code to update authflags, it can be run via cscript.exe. Site Search SiteName Dim SiteLocation SiteName = WScript.Arguments (0) Set SiteObj = GetObject ("IIS: // localhost / W3SVC") for each site in Siteobj if the

  Dim Siteobj Dim Site Site.keytype = "IIsWebServer" then if Site.ServerTomment = SiteName then SiteId = Site.Name SiteLocation = "IIS: // LocalHost / w3svc /" & amp; SiteId SiteLocation = SiteLocation & amp; "/ Root" slow siteview 1 set siteObsubject 1 = GetObject (Site Location) SiteObj1.authflags = 4 SiteObj1.SetInfo End if End if Next Next  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

jquery - SimpleModal Confirm fails to submit form -