다음을 통해 공유


IIsComputer.EnumBackups (ADSI)

The EnumBackups method enumerates metabase backups stored in one or more backup locations, retrieving the location, version number, and date of each backup.

objIIsComputer.EnumBackups(
  bstrLocation As BSTR,
  lIndex As LONG,
  pvVersion As VARIANT,
  pvLocations As VARIANT
) As VARIANT

Parameters

  • bstrLocation
    [in] String containing the location. If an empty string is specified, all backup locations will be searched.

  • lIndex
    [in] Long integer containing the index of the backup to enumerate. Start the index at 0 and increment by 1 until MD_ERROR_DATA_NOT_FOUND (0x800CC801L) is returned. This constant is defined in the Mdmsg.h header file.

  • pvVersion
    [out] Pointer to a VARIANT containing the version number of the backup enumerated.

  • pvLocations
    [out] Pointer to a VARIANT containing the backup location of the backup enumerated.

  • pvDate
    [out] Pointer to a VARIANT containing the date and time of the backup, in Coordinated Universal Time (UTC), formerly GMT (Greenwich Mean Time).

Return Values

This method has no return values.

Example Code

<%@ Language= "VBScript" %>  
<SCRIPT LANGUAGE = "JScript" RUNAT = SERVER>  
  var TempDate = new Date();  
  TempDif = TempDate.getTimezoneOffset();  
  Session("sTempDif") = TempDif;  
</SCRIPT>  
<%  
  Dim CompObj, Index, Version, Location, GMTDate, LocDate, MinDif  
  MinDif = Session("sTempDif")  
  On Error Resume Next  
  Set CompObj = GetObject("IIS://LocalHost")  
  Index = 0  
' Iterate until method returns an error.  
  Do While True  
    ' Empty location input string means enumerate all locations.  
    CompObj.EnumBackups "", Index, Version, Location, GMTDate  
    If Err.Number <> 0 Then  
      ' If error returned, no more backups to enumerate.  
      Exit Do  
    End If  
    Response.Write Version & ", "  
    Response.Write Location & ", "  
    Response.Write GMTDate & ", " 
    ' Convert to server local date and time.  
    LocDate = DateAdd("n", (-MinDif), GMTDate)  
    Response.Write "(" & LocDate & ")"  
    Response.Write "<BR>"  
    Index = Index + 1  
  Loop  
%>  

Requirements

Client: Requires Windows XP Professional, Windows 2000 Professional, or Windows NT Workstation 4.0.

Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.

Product: IIS

See Also

Concepts

IIsComputer (ADSI)

Using ADSI to Configure IIS