I'd like to get the name of the anonymous user account for an IIS install. It's easy enough to assume that it's the machine name, but in the event that the machine name has changed I'd like to still know what it is. Ultimately I'd like to be able to drop this into a bat file or vbscript that I'm using for a website deployment.
The I've gleaned following from the MSDN:
dim schemaObject: set schemaObject = GetObject("IIS://localhost/schema/anonymoususername") dim schemaObjectType: schemaObjectType = schemaObject.syntax WScript.Echo( schemaObjectType )
GetObject() is returning an IISSchemaObject but what property represents the name itself? It's not obvious and I haven't found much in the way of documentation.
Alternatively, is there a way to call the adsutil script and only return the value you're interested in?
cscript adsutil.vbs get w3svc/anonymoususername anonymoususername : (STRING) "IUSR_SERVER-NAME"
I only want "IUSR_SERVER-NAME"