EnumBackups

You can use the EnumBackups method of the IIsComputer object to enumerate metabase backups stored in one or more backup locations, retrieving the location, version number, and date of each backup.

Syntax

IIsComputer.EnumBackups BkupLocIn, IndexIn, BkupVerOut, BkupLocOut, BkupDateTimeOut

 

Parameters
BkupLocIn
A string of up to 100 characters that specifies the backup location. If an empty string is specified, all backup locations will be searched.
IndexIn
Specifies the index of the backup to enumerate. Start the index at 0 and increment by 1 until MD_ERROR_DATA_NOT_FOUND is returned.
BkupVerOut
Receives the version number of the backup enumerated.
BkupLocOut
Receives the backup location of the backup enumerated.
BkupDateTimeOut
Receives the date and time of the backup, in Universal Time Coordinate (UTC), formerly GMT (Greenwich Mean Time).
Code Example
<%@ 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 
%> 
 
See Also

Backup, DeleteBackup, Restore