Properties in IIS mit ADSI

Speedkill

Erfahrenes Mitglied
Hallo allesamt,

ich hoffe ihr könnt mir helfen.

Ich möchte per VB den IIS konfigurieren. Hierzu bietet sich das ADSI an. Nun finde ich auch einiges zu dem Thema und kann schon neue virtuelle Webseiten erstellen, aber ich kann keine Properties setzen.

Ich habe nur einen VBScript code im msdn gefunden aber den kriege ich nicht auf VB portiert da mir die entsprechenden hinweise zu den Objekten und Methoden fehlen.

Wie kann ich per VB und ADSI eine Property hinzufügen (nicht ändern das geht ja einfach sondern hinzufügen).

In VBScript machen die das so:

Code:
' Create an instance of the virtual directory object 
' that represents the default Web site. 
Set IIsWebVDirRootObj = GetObject("IIS://localhost/W3SVC/1/Root")
 
' Use the Windows ADSI container object "Create" method to create ' a new virtual directory. 
Set IIsWebVDirObj = IIsWebVDirRootObj.Create("IIsWebVirtualDir", "NewVDir") 
 
' Use the Windows ADSI object "Put" method to 
' set some required properties. 
IIsWebVDirObj.Put "Path", "C:\NewContent" 
IIsWebVDirObj.Put "AccessRead", True 
IIsWebVDirObj.Put "AccessScript", True 
' Use the AppCreate2 method of the IIS ADSI provider to ' create an application on the new virtual directory. 
IIsWebVDirObj.AppCreate2 1 
IIsWebVDirObj.Put "AppFriendlyName", "NewApp" 
 
' Use the Windows ADSI object "SetInfo" method to ' save the data to the metabase. IIsWebVDirObj.SetInfo

Die Put methode gibt es bei mir nicht da ich in VB ja nicht mit Objects arbeite sondern mit DirectoryEntries um ADSI zu nutzen.

Ich hoffe mir kann einer nen Tipp geben oder ne Seite wo man nachforschen kann.

Grüße
Speedy
 
Zurück