How do you backup IIS's metabase in C#?
exact code will be helpful. I assume the DirectoryServices namespace does it but I can't find the method that does it. ...
exact code will be helpful. I assume the DirectoryServices namespace does it but I can't find the method that does it. ...
I'm by no means a sysadmin so please correct me if I'm wrong. I want to run aspnet_regiis.exe -s. This requires the metabase path of my website. How do I find this metabase path? ...
...or am I stuck rolling my own "XML chopping" functions. I'd like to create a small tasktray app so I can quickly re-point a Virual Directory to one of several of folders on my harddisk. Bit of background: I have 3 different svn branches of our code base on my dev machine. Current Production Branch ( C:\Projects\....\branches\Pro...
I am trying to build a virtual machine that clones one of the servers used in production instances of our webapp so that we can do deployment testing on it. I have gotten all the necessary files over, IIS installed, the database up and running. To my eye all that remains is to copy all the IIS settings from a production environment to ...
I'm using the IISCnfg script provided to copy the metabase from a master server to other servers (10 in total) when we chang our base configuration. Here's the command I'm using: iiscnfg /copy /ts 192.168.5.nnn /tu AdminUser /tp AdminPass /sp /lm/w3svc The main problem is caused because the servers aren't on a domain so the IUSR_ is...
IIS 6.0 generates eTag values in the format of "hash:changenumber". The changenumber goes up every time IIS resets, so your eTag is only valid for the lifetime of your IIS process. Restart, number goes up, hash:changenumber != hash:changenumber+1. The fix for this is to hard-code the changenumber, which is possible using the Metabase E...
IIS 6 and older ships with a utility script called ADSUTIL.VBS: Adsutil.vbs is an IIS administration utility that uses Microsoft Visual Basic Scripting Edition (VBScript) with Active Directory Service Interfaces (ADSI) to manipulate the IIS configuration. This script should be run using CScript, which is installed with...
Hi, I use code like the following in ASP.Net to enumerate the websites in IIS: string metabasePath = "IIS://localhost/W3SVC"; DirectoryEntry service = new DirectoryEntry(metabasePath); service.RefreshCache(); string className = service.SchemaClassName.ToString(); if (className.EndsWith("Service")) { DirectoryEntries sites = servi...
I've found the Stack Overflow question describing how to backup the IIS Metabase in C# here, and I have been successful at getting that to work using the code referenced here. However, I am having difficulty restoring those backups (or indeed any backups created manually in IIS) using C# code. Does anyone know how to do this, or even i...
I have written a bit of code that inspects the iis metabase to see what sites are installed and where their virtual directories are kept. THis code runs fine when run locally on the server. I am trying to extend it so that it works remotely. The thing I'm struggling with getting it to authenticate. I'm currently using the LogonUser api,...
I have an application (written in c#) that allow me to set IIS to allow or deny access to a website from all ip addresses. The application works fine for IIS6 however it does not work with IIS 7 (even with IIS 6 WMI Compatibility installed). heres the code (basically) Type typ = this.Entry.Properties[IIsWebDirectoryProperty.IPSecurity]...
I have searched the web for this and couldn't find anything (well one remotely relevant post), so here I am. We have multiple ASP.NET apps in IIS 6 using Forms Authentication with dedicated path for each app. Since path is case sensitive it must match URL's path section exactly. However, because of an incorrect casing in IIS 6 Metabas...
i'm trying to get the list of mime types known to an IIS server (which you can see was asked and and answered by me 2 years ago). The copy-pasted answer involves: GetObject("IIS://LocalHost/MimeMap") msdn GetObject("IIS://localhost/mimemap") KB246068 GetObject("IIS://localhost/MimeMap") Scott Hanselman's Blog new DirectoryEntry("IIS:...
We are evaluating moving to the Amazon cloud. I want to move the IIS 6 metabase onto an EBS volume so that our domains configuration survives server termination. Is there a way to move the location of the IIS metabase to another drive, or will we just have to setup a regular backup with an automatic restoration when the server restarts? ...
I've been bashing my head against this one for a few days, and haven't had any luck with it. I'm unable to get my VS2010 ASP.NET project to deploy to IIS. I receive the error "Unable to create the virtual directory. To access local IIS Web sites, you must install the following IIS Components IIS 6 Metabase and IIS 6 Configuration Compa...
I'm trying to set up the automated (nightly) installation of my web site setup project. I can specify some install-time values on the command line; in particular, adding a TARGETSITE value defines the web site to which my new deployment will go. How do I find the metabase key to my web site (eg. "/LM/W3SVC/213548468") in an IIS7 instal...
In IIS 6, I typically used code to query the metabase as in the following: var entry = new DirectoryEntry("IIS://localhost/W3SVC"); foreach (DirectoryEntry site in entry.Children) { // Blah } Now in IIS 7, this only functions if IIS 6 compatibility is installed. What I'd really like to do is use the recommended IIS 7 way of doing thi...