How to backup IIS metabase using c#?
Backup IIS metabase using C#
Collapse
X
-
Tags: None
-
Is there any one know the answer of this one.
I got couple of VB scripts that does it, but not a single thing in C#
Is there a way to Backup IIS metabase in c#... -
After searching over the Internet for 3 days..
I have got two VB Scripts , but i dont know how to convert it to C# code.. Can any one help me in this?
---------------Back up IIS Metabase----------------
'**** Start of Script
Dim MyNetowrk
Set MyNetwork = Wscript.createo bject("Wscript. Network")
'**** Runs the IIS Metabase Backup
Dim ComputerObj, iFlags, strDate
Set ComputerObj = GetObject("IIS://" & MyNetwork.Compu tername)
iFlags = (MD_BACKUP_SAVE _FIRST or MD_BACKUP_FORCE _BACKUP)
strDate = Month(date) & "-" & Day(date) & "-" & Year(date) & "-" &
MyNetwork.Compu tername
ComputerObj.Bac kup strDate, MD_BACKUP_NEXT_ VERSION, iFlags
'**** End of Script
---------Restore IIS Meta Base-----------------------
**** Start of Script
Dim MyNetowrk
Dim ComputerObj
Set MyNetwork = Wscript.createo bject("Wscript. Network")
'**** Runs the IIS Metabase Restore
Set ComputerObj = GetObject("IIS://" & MyNetwork.Compu tername)
'**** Restore the highest number version in MyBackups
'**** Mybackups is the name of the last backup of the metabase
'**** All you have to do is type in the name of it and and the vbs script
'**** You could get more fancy on this and do other things, but this is the
'**** basics of it
ComputerObj.Res tore "MyBackups" , MD_BACKUP_HIGHE ST_VERSION, 0
'**** End of ScriptComment
Comment