Virtual Site Binding

   

Virtual Site Binding

In order to manipulate the properties of a site, virtual directory, or resource in the physical file system, you must first instantiate the appropriate interface required to bind the resource.

Note

For all examples in this chapter, you will use the default Web site installed with IIS, which should carry an index number of 1. If you want to manipulate a different site, you must already know the index number of that site. If you have not yet obtained the index number for the site, you may want to consider using one of the enumeration functions described in Chapter 8 to discover the index value assigned to the server .


The following Visual Basic code will bind to the default Web site in the IIS Metabase:

 Dim Site As IADs Dim ServerName As String Dim Index As Long ServerName = "IIS_Server_Name" Index = Site_Index_Value Set Site = GetObject("IIS://" & ServerName & "/W3SVC/" & Index) 

Tip

To bind alternate sites, simply assign the Index variable to the integer representing the site you want to bind .


With the site now bound, you can manipulate the individual properties of the site.


   
Top


Windows NT. 2000 ADSI Scripting for System Administration
Windows NT/2000 ADSI Scripting for System Administration
ISBN: 1578702194
EAN: 2147483647
Year: 2000
Pages: 194
Authors: Thomas Eck

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net