Microsoft KB Archive/311613

= The signature of the EnumBackups method of the IIsComputer object is different in the ADSI provider and in the WMI provider =

Article ID: 311613

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft Internet Information Services 6.0, when used with:
 * Microsoft Windows Server 2003, Standard Edition (32-bit x86)

-



This article was previously published under Q311613



SUMMARY
The EnumBackups method of the IIsComputer object has a different number of parameters in the Active Directory Service Interface (ADSI) provider and in the Windows Management Instrumentation (WMI) provider.



MORE INFORMATION
The ADSI provider and the WMI provider contain scriptable Component Object Model (COM) automation objects that wrap around the Admin Base Object (ABO) interfaces to simplify programmatic configuration of the Internet Information Services (IIS) metabase. You can use the ADSI provider and the WMI provider from COM-compliant languages such as C, C++, Visual Basic, Visual Basic Scripting, JScript, and PerlScript to build applications that manage and configure an IIS server.

ADSI Provider
The ADSI provider is available for all versions of IIS.

You can use the following code to retrieve available metabase backups in the system by using the ADSI provider: Dim ComputerObj 'Retrieve the instance of the computer. Set ComputerObj = GetObject(&quot;IIS://localhost&quot;)

Dim Index, Version, BackupLocation, BackupDate BackupLocation=&quot;&quot;

Do While True 'The empty string input makes sure that all locations of the backups will be enumerated.

ComputerObj.EnumBackups &quot;&quot;, Index, Version, BackupLocation, BackupDate 'Exit the loop if no backups are present. If Err <> 0 Then If Index = 0 Then WScript.Echo Err.Description WScript.Echo &quot;FAIL&quot; WScript.Quit End If       Exit Do    End If

WScript.echo &quot;Index: &quot; & Index WScript.echo &quot;Version: &quot; & Version WScript.echo &quot;Location: &quot; & BackupLocation WScript.Echo &quot;Date: &quot; & BackupDate Index = Index + 1 Loop Notes
 * The EnumBackups method of the IIsComputer object in ADSI provider accepts five parameters. The first parameter is an input parameter and the remaining parameters are the output parameters.
 * The EnumBackups method of the IIsComputer object in ADSI provider works on both Microsoft Windows 2000 Advanced Server and Microsoft Windows Server 2003.

WMI Provider
The WMI provider is available only with Microsoft Internet Information Services (IIS) 6.0. It is not available with IIS 5.1 and earlier versions.

You can use the following code to retrieve available metabase backups in the system by using the WMI provider: Dim ComputerObj, providerObj

'Retrieve the instance of the computer. Set providerObj = GetObject(&quot;winmgmts://localhost/root/MicrosoftIISv2&quot;) Set ComputerObj = providerObj.get(&quot;IIsComputer='LM'&quot;)

Dim Index, Version, BackupLocation, BackupDate Index=0 BackupLocation=&quot;&quot;

Do While True 'The empty string input makes sure that all locations of the backups will be enumerated. ComputerObj.EnumBackups BackupLocation, Index, Version, BackupDate

'Exit the loop if no backups are present. If Err <> 0 Then If Index = 0 Then WScript.Echo Err.Description WScript.Echo &quot;FAIL&quot; WScript.Quit End If       Exit Do    End If

WScript.echo &quot;Index: &quot; & Index WScript.echo &quot;Version: &quot; & Version WScript.echo &quot;Location: &quot; & BackupLocation WScript.Echo &quot;Date: &quot; & BackupDate Index = Index + 1 Loop Notes
 * The EnumBackups method of the IIsComputer object in WMI provider accepts four parameters. The first parameter can be both input and output parameter. The remaining parameters are the output parameters.
 * The EnumBackups method of the IIsComputer object in WMI provider works only on Microsoft Windows Server 2003.

