This post has been imported from the old blog and has not yet been converted to the new syntax yet.
Currently I'm playing around with IIS and C#, and something I discovered is the following:
First, take a look at the FrontPageWeb property available in the IIS Metabase.
This says 'Setting FrontPageWeb to true causes FrontPage Manager to create the files required for FrontPage Server Extensions. Setting FrontPageWeb to false causes these files to be deleted.'.
Everything seems alright, just like every other property I set this to true and except it to work. Like this:
[csharp]
// First we get the AD object representing our webserver
DirectoryEntry iisServerRoot = new DirectoryEntry("IIS://localhost/W3SVC");
// We create a new site on the specified siteId
DirectoryEntry deNewWwwSite = (DirectoryEntry)iisServerRoot.Invoke("Create", "IIsWebServer", 10);
// Takes care of FrontPage Manager providing files for FrontPage Extensions
deNewWwwSite.Properties["FrontPageWeb"][0] = true;
deNewWwwSite.Invoke("SetInfo");
deNewWwwSite.CommitChanges();
deNewWwwSite.Close();
deNewWwwSite.Dispose();
[/csharp]
(Most stuff left out)
Well, it didn't work. In IIS it would still say FrontPage Extensions were not present, and the directories didn't get made.
I looked everywhere to find something else involving FrontPage, without any luck.
But then I found this KB article (300543). And although it's talking about IIS 4.0, 5.0 and 5.1, it does work on IIS 6.0 as well.
So here you go, to install FrontPage Extensions you have to run:
"C:\Program Files\Common Files\Microsoft Shared\web server extensions\50\bin\owsadm.exe" -o install -p /LM/W3SVC/SITEID -u USERNAME -sp publish
And to uninstall them:
"C:\Program Files\Common Files\Microsoft Shared\web server extensions\50\bin\owsadm.exe" -o fulluninstall -p /LM/W3SVC/SITEID -u USERNAME
First, take a look at the FrontPageWeb property available in the IIS Metabase.
This says 'Setting FrontPageWeb to true causes FrontPage Manager to create the files required for FrontPage Server Extensions. Setting FrontPageWeb to false causes these files to be deleted.'.
Everything seems alright, just like every other property I set this to true and except it to work. Like this:
[csharp]
// First we get the AD object representing our webserver
DirectoryEntry iisServerRoot = new DirectoryEntry("IIS://localhost/W3SVC");
// We create a new site on the specified siteId
DirectoryEntry deNewWwwSite = (DirectoryEntry)iisServerRoot.Invoke("Create", "IIsWebServer", 10);
// Takes care of FrontPage Manager providing files for FrontPage Extensions
deNewWwwSite.Properties["FrontPageWeb"][0] = true;
deNewWwwSite.Invoke("SetInfo");
deNewWwwSite.CommitChanges();
deNewWwwSite.Close();
deNewWwwSite.Dispose();
[/csharp]
(Most stuff left out)
Well, it didn't work. In IIS it would still say FrontPage Extensions were not present, and the directories didn't get made.
I looked everywhere to find something else involving FrontPage, without any luck.
But then I found this KB article (300543). And although it's talking about IIS 4.0, 5.0 and 5.1, it does work on IIS 6.0 as well.
So here you go, to install FrontPage Extensions you have to run:
"C:\Program Files\Common Files\Microsoft Shared\web server extensions\50\bin\owsadm.exe" -o install -p /LM/W3SVC/SITEID -u USERNAME -sp publish
And to uninstall them:
"C:\Program Files\Common Files\Microsoft Shared\web server extensions\50\bin\owsadm.exe" -o fulluninstall -p /LM/W3SVC/SITEID -u USERNAME
Cool,
How did you figured that out, it was excelent
Keep up the good work