I used this to find the correct site id:
---------------------------------------
Dim SiteID As Integer
Dim root As New System.DirectoryServices.DirectoryEntry("IIS://" & ServerName & "/W3SVC")
...