The signature of the EnumBackups() method of the IIsComputer object is different in the ADSI provider and in the WMI provider (311613)



The information in this article applies to:

  • Microsoft Internet Information Services version 6.0, when used with:
    • the operating system: Microsoft Windows Server 2003

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("IIS://localhost")

Dim Index, Version, BackupLocation, BackupDate
BackupLocation=""

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

	ComputerObj.EnumBackups "", 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 "FAIL"
			WScript.Quit
		End If
		Exit Do
	End If

	WScript.echo "Index: " & Index
	WScript.echo "Version: " & Version
	WScript.echo "Location: " & BackupLocation
	WScript.Echo "Date: " & 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("winmgmts://localhost/root/MicrosoftIISv2")
Set ComputerObj = providerObj.get("IIsComputer='LM'")

Dim Index, Version, BackupLocation, BackupDate
Index=0
BackupLocation=""

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 "FAIL"
			WScript.Quit
		End If
		Exit Do
	End If

	WScript.echo "Index: " & Index
	WScript.echo "Version: " & Version
	WScript.echo "Location: " & BackupLocation
	WScript.Echo "Date: " & 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.

Modification Type:MajorLast Reviewed:4/2/2004
Keywords:kbSysSettings kbBackup kbProvider kbCompiler kbCommandLine kbinfo KB311613 kbAudDeveloper