473,890 Members | 1,345 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Backup IIS metabase using C#

3 New Member
How to backup IIS metabase using c#?
Nov 22 '06 #1
2 5418
ronneylovely
3 New Member
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#...
Nov 29 '06 #2
ronneylovely
3 New Member
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 Script
Dec 1 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
3314
by: Keith | last post by:
I think we have a corrupt IIS metabase on our web cluster. The controller is replicating the problem to the members. What steps can we take to confirm our IIS metabase is intact? I would prefer not to do ADSI calls. Isn't there a command to interate thru the metabase? Many thanks, Keith
1
6250
by: Roger | last post by:
I need to edit the IIS 6.0 config file (metabase.xml) and had a go with this code, trying to get a list of all defined websites, and write their name to console, but it does not seem to work, would appreciate any pointers: ----------- Try Dim doc As New XmlDocument Dim nodelist As XmlNodeList Dim node As XmlNode
2
1892
by: Raith | last post by:
Hi, I'm trying to write an application to modify certain IIS metabase entries (AllowKeepAlive, ASPProcessorThreadMax etc.) on remote web servers (Win2000 IIS5) over the network. I'm confident using it to modify the metabase on my local machine and it works great, however trying the same on a remote machine gives access denied. Using the following...
5
45573
by: David Veeneman | last post by:
I had to reformat my Windows XP Professional development machine yesterday and reinstall everything, including IIS and VS 2005. I thought I had worked out the procedure to get ASP.NET up and running on a local machine, but I am getting this error when I try to open a web app on the local IIS installation: "Failed to access IIS metabase". Okay--the ASPNET account doesn't have access to the IIS metabase. I ran aspnet_regiis with the -ga...
0
2187
by: Will Holley | last post by:
I have a problem with cache headers which I cannot track down. We are running IIS6 on Windows Server 2003 and ASP.NET 2.0. Our application has an installer which sets up our caching options in the metabase - specifically it sets HttpExpires="D, 0" and CacheControlCustom="no-cache" on the directory containing our web forms. In IIS manager this shows up correctly (saying expires immediately). For some specific web forms (aspx) within...
2
3305
by: Kivak Wolf | last post by:
Hey all, First off, I know some people have had this problem, and I read their post. However, I am still clueless... =( Here's the problem: I have a local IIS on my computer which I am using to run ASP.NET 2.0 locally. However, after I build my web page and try to show it in the browser, it gives this error: ---
1
2055
by: Schemer | last post by:
Hello, I tried to load a web page from my local IIS, and got this error: ----------------------------- Failed to access IIS metabase. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.
2
3991
by: John | last post by:
Hi I am getting the below error while trying to run app. What is the problem and how can I fix it? Thanks Regards
1
4639
by: nagmvs | last post by:
Hello I am unable to upload More than 200kb in to my server and also i can downlaod only less than 4MB file from my server .When i am searching in internet i found solution as u can increase size of Metabase.xml (In IIS) file up to 1GB. Suppose if i increase size of Metabase.xml file up to 200 MB.is there any problems i can face for other applications ? Why microsoft predefined the size of Metabase.xml file as 4MB ? ...
0
9980
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11236
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10925
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5855
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6061
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4682
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4276
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3283
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.