132 lines
5.1 KiB
HTML
132 lines
5.1 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
|
|
<TITLE>GetDataPaths</TITLE>
|
|
<SCRIPT LANGUAGE="JavaScript">
|
|
<!--
|
|
TempString = navigator.appVersion
|
|
if (navigator.appName == "Microsoft Internet Explorer"){
|
|
// Check to see if browser is Microsoft
|
|
if (TempString.indexOf ("4.") >= 0){
|
|
// Check to see if it is IE 4
|
|
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/coua.css">');
|
|
}
|
|
else {
|
|
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/cocss.css">');
|
|
}
|
|
}
|
|
else if (navigator.appName == "Netscape") {
|
|
// Check to see if browser is Netscape
|
|
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/coua.css">');
|
|
}
|
|
else
|
|
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/cocss.css">');
|
|
//-->
|
|
</script>
|
|
<SCRIPT LANGUAGE="VBScript">
|
|
<!--
|
|
Sub Window_OnLoad()
|
|
Dim frmContents
|
|
On Error Resume Next
|
|
If Not Parent Is Nothing Then
|
|
Set frmContents = Parent.Contents
|
|
If Not frmContents Is Nothing Then
|
|
frmContents.Window.TOCSynch_Click
|
|
End If
|
|
End If
|
|
End Sub
|
|
//--></SCRIPT><META NAME="DESCRIPTION" CONTENT="Internet Information Services reference information">
|
|
<META HTTP-EQUIV="PICS-Label" CONTENT='(PICS-1.1 "<http://www.rsac.org/ratingsv01.html>" l comment "RSACi North America Server" by "inet@microsoft.com <mailto:inet@microsoft.com>" r (n 0 s 0 v 0 l 0))'>
|
|
<META NAME="MS.LOCALE" CONTENT="EN-US">
|
|
<META NAME="MS-IT-LOC" Content="Internet Information Services">
|
|
</HEAD>
|
|
|
|
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
|
|
|
|
<H4><A NAME="_k2_getdatapaths"></A><SUP></SUP>GetDataPaths</H4>
|
|
|
|
<P>The ADSI <B>GetDataPaths</B> method can be used with any of the IIS Admin Objects to find the paths to metabase keys where a specified property is located. This method can be used to find occurrences of a property that could be preventing subkeys from inheriting values. The path search will start at the key associated with the object you use <B>GetDataPaths</B> with, and will return the starting path if the property is located at that key. For example, if you use <B>GetDataPaths</B> with the <B>IIsWebServer</B> object for the third Web server, the search path would start at IIS://LocalHost/W3SVC/3 and would return the paths IIS://LocalHost/W3SVC/3, IIS://LocalHost/W3SVC/3/ROOT/VDir1, and IIS://LocalHost/W3SVC/3/ROOT/VDir1/Dir1/File1, if those were the keys where the property was found.</P>
|
|
|
|
<P>A parameter of the method enables you to specify whether to limit your search to seeking only paths of an inheritable property, or all property paths. You can use <B>GetDataPaths</B> to determine if a property is inheritable, as well as where occurrences of it are located.</P>
|
|
|
|
<H6>Syntax</H6>
|
|
|
|
<P><I>PathList = object.</I><B>GetDataPaths</B>(<I>property</I>, <I>AttributeFlag</I>)</P>
|
|
|
|
<P> </P>
|
|
|
|
<H6>Parts</H6>
|
|
|
|
<DL>
|
|
<DT><I>PathList</I></DT>
|
|
|
|
<DD>Receives the list of paths to occurrences of the specified property.<BR>
|
|
</DD>
|
|
|
|
<DT><I>object</I></DT>
|
|
|
|
<DD>Contains an IIS Admin Object, usually as a result of a previous <B>GetObject</B> operation.<BR>
|
|
</DD>
|
|
|
|
<DT><I>property</I></DT>
|
|
|
|
<DD>The name of the property whose paths are to be located.<BR>
|
|
</DD>
|
|
|
|
<DT><I>AttributeFlag</I></DT>
|
|
|
|
<DD>One of the following flags:
|
|
|
|
<TABLE border=0 cellpadding=5 cols=2 frame=box rules=all>
|
|
|
|
<TR VALIGN="top">
|
|
<TD width=52%><B>IIS_ANY_PROPERTY</B></TD>
|
|
<TD width=48%>Retrieve paths regardless of whether the property is inheritable. </TD>
|
|
</TR>
|
|
|
|
<TR VALIGN="top">
|
|
<TD width=52%><B>IIS_INHERITABLE_ONLY</B></TD>
|
|
<TD width=48%>Retrieve paths only if the property is inheritable. Return <B>MD_ERROR_DATA_NOT_FOUND</B> if property is not inheritable. </TD>
|
|
</TR>
|
|
</TABLE><BR>
|
|
|
|
</DD>
|
|
</DL>
|
|
|
|
<H6>Remarks</H6>
|
|
|
|
<P>You can use the <B>For each Path in PathList...Next</B> statement to retrieve individual paths from <I>PathList</I>. </P>
|
|
|
|
<H6>Code Example</H6>
|
|
|
|
<PRE><CODE><%
|
|
Const IIS_ANY_PROPERTY = 0
|
|
Const IIS_INHERITABLE_ONLY = 1
|
|
Const MD_ERROR_DATA_NOT_FOUND = &H800CC801
|
|
Dim WebSvrObj, PathList, vProperty
|
|
On Error Resume Next
|
|
'Get the object for the first Web server.
|
|
Set WebSvrObj = GetObject("IIS://<I>LocalHost</I>/W3SVC/1")
|
|
'Get the paths where a property is located.
|
|
vProperty = "AccessFlags"
|
|
PathList = WebSvrObj.GetDataPaths(vProperty, IIS_INHERITABLE_ONLY)
|
|
If Err.Number = 0 Then
|
|
Response.Write "Paths for property " & vProperty & "<BR>"
|
|
For each Path in PathList
|
|
Response.Write Path & "<BR>"
|
|
Next
|
|
ElseIf Err.Number = MD_ERROR_DATA_NOT_FOUND Then
|
|
Response.Write "Property is not inheritable.<BR>"
|
|
ElseIf Err.Number = &H80005006 Then
|
|
Response.Write "Property does not exist.<BR>"
|
|
Else
|
|
Response.Write "Error " & Err.Number & " " & Err.Description
|
|
End If
|
|
%>
|
|
</CODE></PRE>
|
|
<hr class="iis" size="1">
|
|
<p align="center"><em><a href="../../../common/colegal.htm">© 1997-2001 Microsoft Corporation. All rights reserved.</a></em></p>
|
|
</BODY>
|
|
</HTML>
|