please dont rip this site

ADSI Object Methods

You use the ADSI methods of the IIS Admin Objects to change metabase property values that control your IIS configuration. To configure a specific element of IIS, you open the IIS Admin Object that corresponds to the metabase key associated with that element, modify the property values cached in the object, and direct the object to store the modified values into the metabase.

These ADSI methods of the IIS Admin Objects manipulate metabase properties.

Method Description
Get Retrieves value for a named property from the object.
GetEx Retrieves value(s) for a named single- or multi-valued property of the object.
GetInfo Reloads the object with property values that exist in the metabase.
GetInfoEx Reloads the object with property values from the metabase.
Put Sets the value for a named property of an object.
PutEx Sets value(s) for a named single- or multi-valued property of the object.
SetInfo Writes object property values to the metabase.

The GetInfo method reloads the property values from the metabase into the object. When one of the IIS Admin Objects is created or opened with the GetObject function, its properties are initialized from the metabase. You can refresh these values from the metabase using the GetInfo or GetInfoEx methods, overwriting any changes you have made to the property values cached in the object. You then use the Get or GetEx methods to retrieve the object properties into variables, and the Put and PutEx methods to modify property values in the object. The IIS Admin Objects also support the object.property syntax when used with languages such as VBScript or JScript. You use the SetInfo method to write property values from the object to the metabase. When you call SetInfo, only the properties that you changed in the object are written back to the metabase. If you do not call SetInfo, your changes will not be written to the metabase.

Note When you retrieve metabase properties into one of the IIS Admin Objects, the metabase is not locked while you are changing property values in the object. Other programs may make changes to values in the metabase after you have retrieved values and before you save them back into the metabase. The final values in the metabase will reflect the last change written. Your program should minimize the time between retrieving and saving values.

ADSI properties apply only to the object, and non-ADSI properties apply to the metabase. You must use the object.property syntax when retrieving ADSI properties, whereas you may use either the object.property syntax or the ADSI methods such as Get and Put when manipulating metabase properties.

Example

This sample VBScript code shows how you use the ADSI methods of the IIS Admin Objects to change values in the metabase, and illustrates the use of metabase property inheritance for efficiency. You can use LocalHost instead of MyComputer to access the computer on which IIS is running.

<% 
Dim WebServerObj 
Dim VDirObj 
Dim WritePerm 
 
' Open the object for the first virtual Web server root 
Set WebServerObj = GetObject("IIS://MyComputer/W3SVC/1/Root") 
 
' Deny write access for all directories and files 
' for the server (except those already specifically set) 
' Using the Put method 
WebServerObj.Put "AccessWrite", False 
 
' Save the changed value to the metabase 
WebServerObj.SetInfo 
 
' Get a directory subordinate to the Web server root 
Set VDirObj = GetObject("IIS://MyComputer/W3SVC/1/Root/Vdir1/Dir1a") 
 
' Overwrite the inherited value for write access 
' Using the dot method equivalent to Put 
VDirObj.AccessWrite = True 
 
' Save the changed value to the metabase 
VDirObj.SetInfo 
%> 
 

© 1997 by Microsoft Corporation. All rights reserved.


file: /Techref/inet/iis/iis/htm/sdk/aoii0ewj.htm, 6KB, , updated: 2002/5/22 16:36, local time: 2024/5/14 03:59,
TOP NEW HELP FIND: 
18.190.158.56:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://www.massmind.org/techref/inet/iis/iis/htm/sdk/aoii0ewj.htm"> ADSI Object Methods</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to massmind.org!

 

Welcome to www.massmind.org!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .