I've tried these command lines:
adsutil.vbs create_vserv W3SVC/2
adsutil.vbs create W3SVC/2 "IIsWebServer"
but I'm getting 0x8000500F ("Exception has been thrown by the target of an invocation")
I also get the same exception when calling this from C#:
DirectoryEntry site = (DirectoryEntry)root.Invoke("Create", "IIsWebServer", 2); // or any value for Site ID
I'm running both scenarios as domain admin.
Any ideas?
Thank you,
Mark