I'm trying to use adsutil in an installation script of a web app I am installing on IIS 6.0 to set access control. There is a command that works as follows:
adsutil.vbs set w3svc/1/root/Authflags 4
This is the command for the default web site, as its Identifier is 1. However, new web apps are given a generated Identifier. In my case, the app I installed was given the Identifier of 2082238887, so my command should look like this
adsutil.vbs set w3svc/2082238887/root/Authflags 4
However, I only know this value now from previously installing the app. How would I get this ID during a fresh installation? Every example I have seen for adsutil assumes you are working with the default web site, and therefore an ID of 1.
I need my install script to install the app, get its Identifier, and then use it to set permissions via adsutil.