I am writing an installer class for my web service. In many cases when I use WMI (e.g. when creating virtual directories) I have to know the siteId to provide the correct m
Maybe not the best way, but here is a way :
Example :
Dim oSite As IADsContainer
Dim oService As IADsContainer
Set oService = GetObject("IIS://localhost/W3SVC")
For Each oSite In oService
If IsNumeric(oSite.Name) Then
If oSite.ServerComment = "Default Web Site" Then
Debug.Print "Your id = " & oSite.Name
End If
End If
Next