IIS Metabase Backup

(imported topic written by mmurty)

I have trying to configure a metabase backup for IIS 6.0 using the IISBackup Script provided by Microsoft. IISBackup script is a command line script so you are required to put it in a batch file and run. When i try to do that via bigfix the script fails. I have tried to set the username and password in the script but it still fails (although this does not solve the purpose).

Any thoughts

(imported comment written by brolly3391)

Sounds interesting mmurty,

Can you post the contents of the batch file you are trying to run (with any confidential information covered with *****). There may be a clue to what is failing there.

In cases like these my first thought is “Can this be done in the context of the Local System account?”.

Cheers,

Brolly

(imported comment written by mmurty)

I figured this out. By default the script provided by microsoft runs only from command line. Initially my thoughts were about the local system account. But what i saw was that even a scheduled task of that script did not work. So i created a batch file and set it up as a scheduled task and that worked. Then i configured a task on bigfix using the batch file and it worked like a gem. The batch file is simple. Here it goes:

@echo off

for /F "tokens=2-4 delims=/ " %%f in (‘date /t’) do (

set mm=%%f

set dd=%%g

set yy=%%h

)

set CurDate=%mm%%dd%%yy%

set server=%hostname%

set name=%CurDate%

iisback /backup /b %name%

(imported comment written by mmurty)

Currently i am working on a script for the IIS 5.0 metabase backup

(imported comment written by mmurty)

IIS 5.0 script

Option Explicit

On Error Resume Next

’ Declare variables.

Dim strBackupName, lngBackupVersion, lngBackupFlags

Dim objComputer

Dim strDay, strMonth, strYear

’ Get the current DD/MM/YY as strings.

strDay = Right(“00” & Cstr(Day(Date())),2)

strMonth = Right(“00” & Cstr(Month(Date())),2)

strYear = Cstr(Year(Date()))

’ Create a file name from the current date.

strBackupName = strDay & strMonth & strYear

’ Use the next available version number.

lngBackupVersion = &HFFFFFFFF

lngBackupFlags = 0

’ Output the backup message.

’ Wscript.Echo “Backing up metabase to file: “”” & strBackupName & “”""

’ Get the ADSI object.

Set objComputer = GetObject(“IIS://LOCALHOST”)

’ Call the backup method.

objComputer.Backup strBackupName, lngBackupVersion, lngBackupFlags

’ Check for errors.

'If Err.Number 0 Then

’ Wscript.Echo “Error: " & Err.Description & " (0x” & Right(String(8,“0”) & Hex(Err.Number),8) & “)”

'Else

’ Wscript.Echo “Success.”

'End If

ACTION INFO

download http://192.63.19.12:52311/Uploads/c8c64ccbc6b9b83d32c92a8159f763f75365a8bd/big94.tmp

continue if { (size of it = 615 and sha1 of it = “c8c64ccbc6b9b83d32c92a8159f763f75365a8bd”) of file “big94.tmp” of folder “__Download”}

extract big94.tmp

wait “{pathname of client folder of site “BESSupport” & “\RunQuiet.exe”}” “{pathname of system folder}\cscript.exe” “{(pathname of client folder of current site) & “__Download\mbackup.vbs”}”

(imported comment written by brolly3391)

Hey mmurty,

It looks like you convereted the entire thing to a vbs and are running that instead. Looks like solid work.

Thanks for bringing your results back for the cummunity.

Cheers,

Brolly

(imported comment written by mmurty)

u r welcome