<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Maxime Bombardier - SharePoint Architecture &amp; Development : Variations</title><link>http://blogs.msdn.com/maximeb/archive/tags/Variations/default.aspx</link><description>Tags: Variations</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Updating site parameters using the API may freeze the variation job</title><link>http://blogs.msdn.com/maximeb/archive/2008/04/26/updating-site-parameters-using-the-api-may-freeze-the-variation-job.aspx</link><pubDate>Sat, 26 Apr 2008 16:32:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8427302</guid><dc:creator>MaximeB</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/maximeb/comments/8427302.aspx</comments><wfw:commentRss>http://blogs.msdn.com/maximeb/commentrss.aspx?PostID=8427302</wfw:commentRss><description>&lt;p&gt;As you probably know if you read my blog, we like to automate as much as we can our WCM portal deployments.&amp;nbsp; One of the thing we do is to update the Publishing Navigation to hide some sites/pages or simply re-order them correctly.&amp;nbsp; Unfortunately, when you have variations and you want to automate this for all languages, you have to specify some kind of "sleep" time so that it waits for the Variation Timer Job to kick in and create the site in all labels.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Obviously, the sleep time period is guess work and is different on all servers (even on the same one!).&amp;nbsp; During the first attempts, our sleep timer was rather low and we noticed that if we tried opening a site in a target variation/label while the variation process was doing its work, the process was simply stopping!&amp;nbsp; I tried restarting the OWSTIMER service, rebooting the server, wait a day ... but no luck, it simply wasn't picking up again.&amp;nbsp; The Timer Job definitions were still 'running' every minutes, they simply didn't check if there was any updates to propagate.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Unfortunately, so far, I haven't found a way to fix it and to be honest, we simply delayed running our updates on all labels to a later stage.&amp;nbsp; While I did take a look at trying to 'kick start' the process, I didn't go very deep and if I have the issue again, I'll try &lt;a href="http://stsadm.blogspot.com/2008/04/fix-variation-relationships-list.html" target="_blank"&gt;Gary Lapointe's variation relationship fix&lt;/a&gt; (which is VERY interesting and practical even if you don't have the issue I outlined here).&amp;nbsp; If that doesn't work, I'll go see if the relationship are created anyway but it's the Timer Job that cannot read them anymore.&amp;nbsp; I'll update the post when I have the time to reproduce the error and debug it.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Maxime&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8427302" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/maximeb/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/Web+Content+Management/default.aspx">Web Content Management</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/Variations/default.aspx">Variations</category></item><item><title>Deployment lifecycle when using Site Definitions and Features (including post production day)</title><link>http://blogs.msdn.com/maximeb/archive/2008/02/23/deployment-lifecycle-when-using-site-definitions-and-features-including-post-production-day.aspx</link><pubDate>Sat, 23 Feb 2008 16:14:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7857203</guid><dc:creator>MaximeB</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/maximeb/comments/7857203.aspx</comments><wfw:commentRss>http://blogs.msdn.com/maximeb/commentrss.aspx?PostID=7857203</wfw:commentRss><description>&lt;h4&gt;&lt;strong&gt;Summary &lt;/strong&gt;&lt;/h4&gt; &lt;p&gt;As you have noticed, I've changed my latest SharePoint focus to look at Site Definitions (and obviously Features but I played with them a lot prior to this).&amp;nbsp; The reason for this is that I was looking at the "best" way to deploy artifacts for SharePoint WCM portals.&amp;nbsp; While I had a very good working solution prior to me playing more with Site Definitions, I now think that I am ready to handle the task much better.&amp;nbsp; This is also a follow-up to a previous article : &lt;a href="http://blogs.msdn.com/maximeb/archive/2008/01/13/real-life-team-based-development-for-web-content-management-with-sharepoint-2007.aspx" target="_blank"&gt;http://blogs.msdn.com/maximeb/archive/2008/01/13/real-life-team-based-development-for-web-content-management-with-sharepoint-2007.aspx&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;The reason for this is that there is no single way to deploy SharePoint artifacts.&amp;nbsp; Worst, once you deployed the first time, your original mechanism may not work anymore or if it does, it's probably not what you should use!&amp;nbsp; What I'll attempt to do here is to define a few SharePoint artifacts that we deploy in a Web Content Management scenario for both production day and post production day, as well as the deployment lifecycle for the developers pre-production-day and post-production-day.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h4&gt;&lt;strong&gt;SharePoint artifacts we'll cover:&lt;/strong&gt;&lt;/h4&gt; &lt;ul&gt; &lt;li&gt;Master pages&lt;/li&gt; &lt;li&gt;Page Layouts&lt;/li&gt; &lt;li&gt;CSS / JavaScripts / Images (for the masterpages and layouts)&lt;/li&gt; &lt;li&gt;Site Columns &amp;amp; Site Content Types&lt;/li&gt; &lt;li&gt;Library content types association&lt;/li&gt; &lt;li&gt;Custom Lists&lt;/li&gt; &lt;li&gt;Event Handlers on libraries&lt;/li&gt; &lt;li&gt;Feature Receivers&lt;/li&gt; &lt;li&gt;Timer jobs&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h4&gt;&lt;strong&gt;SharePoint topics discussed: &lt;/strong&gt;&lt;/h4&gt; &lt;ul&gt; &lt;li&gt;Site Definitions&lt;/li&gt; &lt;li&gt;Features&lt;/li&gt; &lt;li&gt;Variations&lt;/li&gt; &lt;li&gt;Feature Stapling&lt;/li&gt; &lt;li&gt;Timer Jobs&lt;/li&gt; &lt;li&gt;Content Deployment&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h4&gt;&lt;strong&gt;Why Site Definitions?&lt;/strong&gt;&lt;/h4&gt; &lt;p&gt;The timing of me digging Site Definitions more and this post, &lt;a href="http://www.andrewconnell.com/blog/archive/2008/02/15/You-dont-need-to-create-site-definitions.aspx" target="_blank"&gt;http://www.andrewconnell.com/blog/archive/2008/02/15/You-dont-need-to-create-site-definitions.aspx&lt;/a&gt;,&amp;nbsp; from Andrew Connell was interesting.&amp;nbsp; First of all, he's right, you do not need to create a Site Definition all the time.&amp;nbsp; However, there are also general guidelines.&amp;nbsp; When you look at the Publishing portal that is available out of the box, it really looks like a good sample for reverse-engineering (and believe me, I opened it often to learn stuff!).&amp;nbsp; How often have you kept the original "Press Releases" sub-site or used "Blueband" or any other master for your site?&amp;nbsp; What Andrew mentions is that you should create your own minimal publishing site or you can take a look at this one &lt;a href="http://www.codeplex.com/features" target="_blank"&gt;here&lt;/a&gt; on CodePlex but I suggest you still take it apart with your requirements.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Also, I'm almost always in a multilingual scenario (i.e.: SharePoint Variations) and then Site Definitions takes its full meaning.&amp;nbsp; Why? well the Variation mechanism is really just a system that provision sites.&amp;nbsp; It is &lt;strong&gt;&lt;em&gt;not&lt;/em&gt;&lt;/strong&gt; a copy of the source site.&amp;nbsp; When the variation timer job kicks in, it will detect a new site in the source variation.&amp;nbsp; When it reads it, it takes the title, the description, the URL and the Site Template (i.e.: site definition).&amp;nbsp; Then it simply does a standard Create Site... with those parameters.&amp;nbsp; Once that is done, it will replicate only the &lt;strong&gt;publishing fields of the welcome page&lt;/strong&gt;.&amp;nbsp; Last, it will provision the other publishing pages the same way and replicate only the publishing fields on those pages.&amp;nbsp; &lt;strong&gt;Note that any customization done manually at the source, beside publishing pages and fields, will NOT be brought to the other variations.&amp;nbsp; That includes libraries undefined in the site definitions, documents or images, versioning settings, workflows, and everything else you see in the user interface that isn't a publishing field!&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;I think my last sentence was obvious enough that if you customize something at the source, you will customize it again at the destination.&amp;nbsp; While there may be scenarios when you might want this, it'll be unusual and the solution is to use Site Definitions so that the provisioning brings as much as possible.&lt;/p&gt; &lt;p&gt;&lt;br&gt;I'll finish this section with an example: today, if you have a Publishing site with the OOB site definition and that your welcome pages aren't "WelcomeLinks", what do you do?&amp;nbsp; First of all, at the source, you created a new page with your layout.&amp;nbsp; Then you updated the welcome page of your site to your new page and deleted the old "default.aspx".&amp;nbsp; Now all your welcome pages are not "default.aspx" but it's no big deal.&amp;nbsp; When you created a 2nd variation label, all the default.aspx/WelcomeLinks are back and they are the welcome pages of your sites in that variation!!&amp;nbsp; So you again updated the welcome page and deleted the default.aspx.&amp;nbsp; That's not very user friendly.&amp;nbsp; Also, if you wanted to ended up renaming your custom page to "default.aspx", the variation mechanism would break when trying to provision the site since it's the name for the WelcomeLinks.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;As you can see, Site Definitions becomes a must when using variations.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h4&gt;&lt;strong&gt;What defines a Site Definitions?&lt;/strong&gt;&lt;/h4&gt; &lt;p&gt;First of all, there is no golden rule for this but here's what I personally follow to determine if I use the same definition or a new one:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;A different welcome page layout&lt;/li&gt; &lt;li&gt;I want to pre-provision a default set of web parts in a welcome page layout&lt;/li&gt; &lt;li&gt;(f) I want to associate specific content types to libraries&lt;/li&gt; &lt;li&gt;(f) I want to allow specific page layouts creation (i.e.: a "news" only section, a "product" only section, etc.)&lt;/li&gt; &lt;li&gt;(f) I want to add special Site Actions for some sites&lt;/li&gt; &lt;li&gt;(f) I want to have a special workflow for some sites&lt;/li&gt; &lt;li&gt;(f) I want to update library settings for some sites&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;em&gt;Note that the items prefixed by "(f)" are items where the delivery mechanism is Features but they are associated in some site definitions.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Also, one note that will affect your site definition architecture are Feature Stapling.&amp;nbsp; That functionality is one of the very practical mechanism to apply a feature to a site definition.&amp;nbsp; Unfortunately, it's also "only that".&amp;nbsp; What I mean is that if you have multiple sites with the same definition, it will apply the feature on all those sites.&amp;nbsp; This is great inside a single Site Collection but when your SharePoint farm contains multiple site collections (possibly for different customers), you may not want to apply a feature to all of them.&amp;nbsp; Unfortunately, I do not personally know of a better solution than to create your Site Definitions "per site collection" only (i.e.: in the naming).&amp;nbsp; They will still likely use the same features though.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;And really, when I design Site Definitions, I created a Feature that contains all the Features that I use for ALL sites.&amp;nbsp; That way, my Site Definitions are very small and only contains the customization for that site.&amp;nbsp; Also, I suggest taking a look at this tool to read your sites definitions : &lt;a href="http://blogs.msdn.com/maximeb/archive/2008/02/16/site-definition-viewer-a-windows-net-2-0-tool-to-read-site-definition-and-features-configurations-version-0-1.aspx" target="_blank"&gt;http://blogs.msdn.com/maximeb/archive/2008/02/16/site-definition-viewer-a-windows-net-2-0-tool-to-read-site-definition-and-features-configurations-version-0-1.aspx&lt;/a&gt;.&amp;nbsp; I also created some CMD files to automate development of site definitions and they come in handy to maximize your time.&amp;nbsp; I will post them soon.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;strong&gt;&lt;em&gt;Before taking a look at the SharePoint artifacts, I need to give you a bit of background on how we get the artifacts: We set up a MOSS server only for "web integrators".&amp;nbsp; The Site Collections in there contains the files directly in the database edited through SharePoint Designer.&amp;nbsp; We hooked up an event on the libraries that, when a check-in is done, it brings the file in a Team Foundation Server.&amp;nbsp; Then, we have someone maintaining the build process and when he get the "go" from the web integrators, he builds the feature containing the files and that is sent to the developers for updates and eventually to production.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h4&gt;&lt;strong&gt;SharePoint artifact deployment - Master Pages - Page Layouts - CSS/JS/Images&lt;/strong&gt;&lt;/h4&gt; &lt;h4&gt;1) Pre-production "day 1"&lt;/h4&gt; &lt;p&gt;You should create a site-scoped Feature containing your master pages and other files (pages layouts and css/js/images).&amp;nbsp; Take a look at the PublishingLayouts for ideas.&amp;nbsp; When this feature is activated on a site collection, it will add the file in the libraries in a ghosted format which means that there are no customization on them.&amp;nbsp; Note that if you ever unghost it at the destination, your feature will never update the file after.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h4&gt;2) Post-production "day 2+"&lt;/h4&gt; &lt;p&gt;We'll have to define some sub-scenarios but first, let's start that, yes, you &lt;strong&gt;may&lt;/strong&gt; be able to uninstall the feature and reinstall it while using the -force command but I do not recommend it.&amp;nbsp; First, as I just mentioned, if you unghosted a file, it will not be updated.&amp;nbsp; So if you plan on using this technique, make sure you test first.&amp;nbsp; Also, I had some issues with BlobCache with CSS/JS/GIF/JPG but only when they were ghosted, never when unghosted.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Scenario #1 Updates to some/all the files&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;I would suggest creating an STSADM extension that update files defined in your Feature.&amp;nbsp; This extension will unghost the file and it will act as your mechanism to deploy updates.&amp;nbsp; What I use is a simple extension with an Xml input file that defines the files to update.&amp;nbsp; This file simply grows over time since I only append to it.&amp;nbsp; It gives me an added benefit with "change management" since it's not simply a build that picked up all files and sent it in the feature which may contain an update.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Scenario #2 New files&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;If you have new files, you probably have a "business reason" behind.&amp;nbsp; For a new master pages or page layout, is it only for a new type of site (i.e.: defined in a site definition) or would you like to apply it automatically on some/all sites?&amp;nbsp; That you have a new site definition or not, you are likely to have a new feature that brings the file.&amp;nbsp; This feature may contain a Feature Receiver that will do some actions with those files such as :&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Assigning the master page to some sites&lt;/li&gt; &lt;li&gt;Allowing the page layout to be created in some/all sites&lt;/li&gt; &lt;li&gt;If you have a new site definition, you may want to add it in the list of available web templates&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Once you have your feature, you may want to create another one to staple the first feature with your site definition (some or all of them).&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;For new CSS/JS/images, they are probably used by a new page layout or master to being with so they will go in the same new feature.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h4&gt;3) Developers Pre/Post production day&lt;/h4&gt; &lt;p&gt;During the initial development phase "pre-production day", developers should update their environment when they need it.&amp;nbsp; Since I have everything in Team Foundation, I created special CMD/Bath files for developers that helps them clean/create a site definition with some sub-sites already pre-populated.&amp;nbsp; This is enough for most cases.&amp;nbsp; It's clean and fast and they are up and running quickly.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;"Post-production day", the site definitions will not be updated (although they can be appended), nor the features, so they should run the same script that add files in the database and install the new features.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt; &lt;h4&gt;SharePoint artifact deployment - Site Columns and Site Content types + library association&lt;/h4&gt; &lt;h4&gt;1) Pre-production "day 1"&lt;/h4&gt; &lt;p&gt;Feature is the best mechanism to bring columns and content types.&amp;nbsp; Note that the feature has to be Site scoped so it will not bring the content types to a library unless you &lt;em&gt;manually create a page through the GUI&lt;/em&gt; or that you use a content type association feature in your site definition.&amp;nbsp; You can take a look at &lt;a href="http://www.andrewconnell.com/blog/archive/2007/10/29/My-MOSS-WCM-STSADM-custom-commands-have-been-updated.aspx" target="_blank"&gt;Andrew Connell's STSADM extension&lt;/a&gt; for a good sample of exporting your columns/content types.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h4&gt;2) Post-production "day 2+"&lt;/h4&gt; &lt;p&gt;Well we learned the hard way, since the MSDN documentation wasn't available back then, that if you add a column to a content type (in a feature), a "reinstall" of the feature will only bring the new column at the Site Collection level and it will not be replicated down to each libraries using that content type.&amp;nbsp; Fortunately, the user interface works great so if you do not have many columns to add, you may simply want to document the manual update. &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;But you know I like automation ... so yes, we are also fortunate with the API and it replicates down the change as well.&amp;nbsp; An STSADM extension that adds column + associate it to a content type can be done easily so that it reads an Xml input file with all the updates since Day 1.&amp;nbsp; When it runs, if the column's already there, it simply skips it and go check if the content type contains the association to it.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h4&gt;3) Developers Pre/Post production day&lt;/h4&gt; &lt;p&gt;The same process will apply for developers.&amp;nbsp; However, since the "STSADM extension" isn't created until Day 1, they may either recreate their site collection or manually add the column/content types when a change occurs.&amp;nbsp; In my case, since creating a site definition is scripted, it goes very fast.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h4&gt;&lt;strong&gt;SharePoint artifact deployment - Custom lists&lt;/strong&gt;&lt;/h4&gt; &lt;h4&gt;1) Pre-production "day 1"&lt;/h4&gt; &lt;p&gt;A custom list is defined in a feature.&amp;nbsp; The definition contains the columns and types.&amp;nbsp; An instance of a list is defined in a Site Definition or through the user interface.&amp;nbsp; You can also populate rows of data for an instance of a list defined in the Site Definition.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h4&gt;2) Post-production "day 2+"&lt;/h4&gt; &lt;p&gt;That one is tricker, you can update and reinstall the feature.&amp;nbsp; However, that will only affect new list creation.&amp;nbsp; I personally haven't gotten the need to add columns and data to a list post-production but I would likely need another little STSADM extension to update it.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h4&gt;3) Developers Pre/Post production day&lt;/h4&gt; &lt;p&gt;Same process as the content types, if it's only a feature, then reinstall it.&amp;nbsp; If it's in the site definition, run the creation script.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt; &lt;h4&gt;&lt;strong&gt;SharePoint artifact deployment - Event Handlers, Feature Receivers, and Timer Jobs&lt;/strong&gt;&lt;/h4&gt; &lt;h4&gt;1) Pre-production "day 1"&lt;/h4&gt; &lt;p&gt;All of these are class items.&amp;nbsp; You may want to run code for a specific event on a library, run code when a feature's activated, or run code through a timer job at a specific time.&amp;nbsp; All of them are also originally brought through a feature.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h4&gt;2) Post-production "day 2+"&lt;/h4&gt; &lt;p&gt;Now, this can be either very easy or much harder depending on how "politically correct" you want to be.&amp;nbsp; Technically (or less politically correct), the classes are either in the BIN or the GAC, if you need to update the code, you can simply deploy them without touching anything in SharePoint (beside an application recycling or an IISRESET).&amp;nbsp; &lt;em&gt;That is, only if you kept the same assembly version.&lt;/em&gt;&amp;nbsp; &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Unfortunately, if you want to be more politically correct, you'd have to change the feature, since it contains the assembly version, and reinstall it but there are cases when it seems that some references are "ghosted" somewhere in a database so it may not work.&amp;nbsp; If you want to be politically correct (and normally, we should) with assembly versions, I would strongly suggest doing tests.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h4&gt;3) Developers Pre/Post production day&lt;/h4&gt; &lt;p&gt;For pre-production day, it's easy, the version isn't likely to change much so you are good to deploy the DLL and reset IIS/app pool.&amp;nbsp; Post production day will depend on what you chose in scenario 2.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h3&gt;Content Deployment with all this&lt;/h3&gt; &lt;p&gt;As long as your site definitions, features, and assemblies are all deployed at the destination, Content Deployment will work great with your artifacts.&amp;nbsp; Sounds simple but even with all my run-ins with Content Deployment, it works good in that scenario.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Hope it helps a bit.&amp;nbsp; I know it's a bit sad that there isn't a "single scenario" and I'm still using STSADM extensions to do some updates, but remember, most of the updates are doable from either SharePoint Designer or the web user interface.&amp;nbsp; These 2 tools works good for the updates.&amp;nbsp; Unfortunately, this version of the product doesn't seem to include the fact that field WCM deployments often have a more rigid and secure environment and SPD users aren't likely to play in production or even staging.&amp;nbsp; That's when we, developers, want to automate the process and that's when we create STSADM extensions to fill the gap.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Maxime&lt;/p&gt; &lt;p&gt;&lt;embed src="http://card.mygamercard.net/Mumren.swf" width="198" height="135" type="application/x-shockwave-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"&gt;&lt;/embed&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7857203" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/maximeb/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/Web+Content+Management/default.aspx">Web Content Management</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/STSADM+Extensions/default.aspx">STSADM Extensions</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/Variations/default.aspx">Variations</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/EventHandlers/default.aspx">EventHandlers</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/Content+Deployment/default.aspx">Content Deployment</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/SharePoint+Architecture+_2600_+Design/default.aspx">SharePoint Architecture &amp; Design</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/Site+Definitions+and+Features/default.aspx">Site Definitions and Features</category></item><item><title>Beware of SPWebProvisioningProvider when using Variations</title><link>http://blogs.msdn.com/maximeb/archive/2008/02/05/beware-of-spwebprovisioningprovider-when-using-variations.aspx</link><pubDate>Tue, 05 Feb 2008 20:22:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7470659</guid><dc:creator>MaximeB</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/maximeb/comments/7470659.aspx</comments><wfw:commentRss>http://blogs.msdn.com/maximeb/commentrss.aspx?PostID=7470659</wfw:commentRss><description>&lt;p&gt;I was doing some research lately on how to have a different "Approvers" group depending on business rule.&amp;nbsp; To make it simple, the following statement had to be fulfilled:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Pages under subsite "/site1" have to be approved by group "Approvers1"  &lt;li&gt;Pages under subsite "/site2" have to be approved by group "Approvers2"  &lt;li&gt;and so on...  &lt;li&gt;We are in a multilingual scenario (i.e.: Variations)&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;we also have custom site definitions for modifying the default welcome page to something else than WelcomeLinks as well as bringing our content types in the library.&amp;nbsp; So the first thing we looked at was to use SPWebProvisioningProvider that allows to execute a class when provisioning a site.&amp;nbsp; You can take a look at these URLs for more explanation on SPWebProvisioningProvider:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://weblogs.asp.net/paulballard/archive/2007/04/09/creating-a-custom-sharepoint-2007-portal-site-definition-using-the-portalprovisioningprovider-class.aspx"&gt;http://weblogs.asp.net/paulballard/archive/2007/04/09/creating-a-custom-sharepoint-2007-portal-site-definition-using-the-portalprovisioningprovider-class.aspx&lt;/a&gt;  &lt;li&gt;(French) &lt;a href="http://blogs.developpeur.org/themit/archive/2007/10/18/sharepoint-deployment-feature-feature-solution-mais-aussi-webprovisioningprovider.aspx"&gt;http://blogs.developpeur.org/themit/archive/2007/10/18/sharepoint-deployment-feature-feature-solution-mais-aussi-webprovisioningprovider.aspx&lt;/a&gt;  &lt;li&gt;&lt;a href="http://www.pings.dk/blog/archive/2007/10/18/create-a-web-provisioner-to-enable-quote-post-site-creation-actions-quote.aspx"&gt;http://www.pings.dk/blog/archive/2007/10/18/create-a-web-provisioner-to-enable-quote-post-site-creation-actions-quote.aspx&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;So basically, a site definition reside in the "onet.xml" file and you cannot define a class in that file.&amp;nbsp; The WEBTEMP*.xml (defined in all "available languages", i.e.: 1033 folder for english) file is the configuration used by the "Create site" interface.&amp;nbsp; This is where you specify your custom class for provisioning a web.&amp;nbsp; The first thing your custom class does is to use ApplyWebTemplate() so that the web site is created with the correct template.&amp;nbsp; Then I was simply modifying the "AssociationData" of the only workflow (Parallel Approval) to update its "Approvers" to my custom one depending on the URL.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;So far, so good.&amp;nbsp; Unfortunately, when you create this under a variation, it only works at the source.&amp;nbsp; The reason for this is that the variation process is only a provisioning mechanism; furthermore, it's only provisioning based on the site definition, not any customization done after.&amp;nbsp; That includes customization done through a SPWebProvisioningProvider.&amp;nbsp; So basically, while the "onet.xml" file is called by the variation process, the "WEBTEMP*.xml" isn't.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;What I ended up doing was to create a feature that contained the same code and added it to my site definition.&amp;nbsp; If the sites are already deployed, you can look at at using Feature Stapling to do the same thing.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;In my opinion, the SPWebProvisioningProvider should be a more accurate place to do this code as I want to customize another Feature through business logic.&amp;nbsp; Of course, I could copy the ReviewWorkflow and create as many of them as I need plus as many Site Definitions for them, which might be okay for SharePoint, but wouldn't be a very reusable approach.&amp;nbsp; I also find curious that we have a great customizable solution with the provider but it's simply not being called through the variation mechanism.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Maxime&lt;/p&gt; &lt;p&gt;&lt;embed src="http://card.mygamercard.net/Mumren.swf" width="198" height="135" type="application/x-shockwave-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"&gt;&lt;/embed&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7470659" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/maximeb/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/Web+Content+Management/default.aspx">Web Content Management</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/Variations/default.aspx">Variations</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/SharePoint+Architecture+_2600_+Design/default.aspx">SharePoint Architecture &amp; Design</category></item><item><title>You receive an error when you create a page, as a SharePoint Member, for the first time in a sub-site</title><link>http://blogs.msdn.com/maximeb/archive/2007/10/27/you-receive-an-error-when-you-create-a-page-as-a-sharepoint-member-for-the-first-time-in-a-sub-site.aspx</link><pubDate>Sat, 27 Oct 2007 15:19:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5709948</guid><dc:creator>MaximeB</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/maximeb/comments/5709948.aspx</comments><wfw:commentRss>http://blogs.msdn.com/maximeb/commentrss.aspx?PostID=5709948</wfw:commentRss><description>&lt;p&gt;We ran into a little issue the other day when using an account with only Member rights (yes yes, we are usually admins :)), we were creating a page for the first time in a sub-site and we were receiving a beautiful stack trace of nothingness.&amp;nbsp; We refreshed the page and it was working fine, the page was added.&amp;nbsp; With an account that's admin or owner, we didn't have that problem.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Now, we are creating the whole site structure programmatically through an STSADM and we are setting the AvailablePageLayouts collection per web application as to limit the type of pages authors can create for each sub-site.&amp;nbsp; And I remembered an issue with Variations where the ContentTypes collection for each "target" variations weren't set correctly by the variation job.&amp;nbsp; So I guessed right, we pre-populated the ContentTypes collection for each sub-site to contain a reference of all site content types that we accept for each sub-site and the error disappeared.&amp;nbsp; Since we had the whole extension with an Xml input, it wasn't hard at that point to add "Available" ContentTypes to it.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;It's quite possible that the GUI for updating AvailablePageLayouts does that, I didn't use Reflector on it nor did I check the ContentTypes collection when using the GUI, but my guess would be that the error's a bug since if you refresh the page creation, the content type is indeed added at that point and the 2nd creation will work.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Maxime&lt;/p&gt; &lt;p&gt;&lt;embed src="http://card.mygamercard.net/Mumren.swf" width="198" height="135" type="application/x-shockwave-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"&gt;&lt;/embed&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5709948" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/maximeb/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/Web+Content+Management/default.aspx">Web Content Management</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/STSADM+Extensions/default.aspx">STSADM Extensions</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/Variations/default.aspx">Variations</category></item><item><title>Small bug preventing from approving in French sites/variations (SharePoint)</title><link>http://blogs.msdn.com/maximeb/archive/2007/10/07/small-bug-preventing-from-approving-in-french-sites-variations-sharepoint.aspx</link><pubDate>Sun, 07 Oct 2007 19:27:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5346050</guid><dc:creator>MaximeB</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/maximeb/comments/5346050.aspx</comments><wfw:commentRss>http://blogs.msdn.com/maximeb/commentrss.aspx?PostID=5346050</wfw:commentRss><description>&lt;p&gt;One of my co-worker, &lt;a href="http://www.philippebedard.net"&gt;Philippe Bédard&lt;/a&gt;, found a little bug last week that was preventing users to approve images in a French publishing web site. Basically, if you use the "View All Site" and navigate to a library that contains unapproved items, the contextual menu will show a "Approve" button.&amp;nbsp; This button will take you to a page that contains a JavaScript to confirm your action.&lt;/p&gt; &lt;p&gt;&lt;br&gt;Problem is, in French, the text (from a resource file) contains an apostrophe (') without encoding it for Javascript (\').&amp;nbsp; The Javascript simply breaks and the button doesn't fire.&amp;nbsp; Luckily, you can approve from a different page through the Manage Content and Structure button and approve from there.&amp;nbsp; The page that uses that resource is "_layouts/approve.aspx".&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;To fix the issue temporarily (until we have an official fix, otherwise, the resource file can be replaced by any fix/service pack), you can modify the wss.fr-fr.resx file that is contained in the 12 hive (12\Config\Resources) directory as well as any web site's App_GlobalResources directories.&amp;nbsp; Look for the "approve_canleWorkflow_alert" (yes, typo there in the resource file, even better :)) and update the apostrophe.&amp;nbsp; Here's what the resource file looks like :&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;u&gt;Original version:&lt;/u&gt; &lt;p&gt;&amp;lt;data name="approve_CancleWorkflow_alert"&amp;gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;value&amp;gt;Un flux de travail d'approbation du contenu est actuellement exécuté pour approuver cet élément. Si vous poursuivez cette opération, le flux de travail sera annulé.&amp;lt;/value&amp;gt; &lt;p&gt;&amp;lt;/data&amp;gt; &lt;p&gt;&amp;nbsp; &lt;p&gt;&lt;u&gt;Fixed version:&lt;/u&gt; &lt;p&gt;&amp;lt;data name="approve_CancleWorkflow_alert"&amp;gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;value&amp;gt;Un flux de travail d\'approbation du contenu est actuellement exécuté pour approuver cet élément. Si vous poursuivez cette opération, le flux de travail sera annulé.&amp;lt;/value&amp;gt; &lt;p&gt;&amp;lt;/data&amp;gt; &lt;p&gt;&amp;nbsp; &lt;p&gt;Thanks Philippe ! &lt;p&gt;&amp;nbsp; &lt;p&gt;&amp;nbsp; &lt;p&gt;Maxime &lt;p&gt;&lt;embed src="http://card.mygamercard.net/Mumren.swf" width="198" height="135" type="application/x-shockwave-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"&gt;&lt;/embed&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5346050" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/maximeb/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/Web+Content+Management/default.aspx">Web Content Management</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/Variations/default.aspx">Variations</category></item><item><title>My STSADM extension toolbox</title><link>http://blogs.msdn.com/maximeb/archive/2007/10/06/my-stsadm-extension-toolbox.aspx</link><pubDate>Sat, 06 Oct 2007 21:34:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5320345</guid><dc:creator>MaximeB</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/maximeb/comments/5320345.aspx</comments><wfw:commentRss>http://blogs.msdn.com/maximeb/commentrss.aspx?PostID=5320345</wfw:commentRss><description>&lt;p&gt;Here's a listing of custom STSADM extensions myself and my coworkers have created.&amp;nbsp; Feel free to ask questions regarding the namespaces for these.&amp;nbsp; I'd like to thank those who contributed to this : Stéphane Perron, Louis Fournier, and Vincent Trépanier at &lt;a href="http://www.orckestra.com"&gt;Orckestra&lt;/a&gt;, an outstanding partner for SharePoint, Biztalk, and Commerce in Montreal; and a co-worker Philippe Bédard.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;BaseStsAdmExtension&lt;/strong&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;The basic class for all my extensions.&amp;nbsp; It adds up default classes for a common output, verbose output switch, Url switch, and a wait switch to allow a developer to attach to the process.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;ContentBuilder&lt;/strong&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Generates all columns, content types, page layouts, style sheets, site collection images, and master pages in a Feature.&amp;nbsp; The "files" have to be exported (and we have another mechanism for that) in order to import them in another site.&amp;nbsp; This was originally taken from &lt;a href="http://andrewconnell.com/blog/articles/MossStsadmWcmCommands.aspx"&gt;http://andrewconnell.com/blog/articles/MossStsadmWcmCommands.aspx&lt;/a&gt; and then updated to fix a few issues and add more elements.&amp;nbsp; You can also find information on Features here : &lt;a title="Working with Features" href="http://msdn2.microsoft.com/ms460318.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms460318.aspx&lt;/a&gt; and here &lt;a href="http://www.codeproject.com/spoint/ExtendingSPS.asp"&gt;http://www.codeproject.com/spoint/ExtendingSPS.asp&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;PreloadWebSites&lt;/strong&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;A simple extension that reads an input Xml file and hits all the specified Urls with HttpWebRequests.&amp;nbsp; This helps loading specific content types &amp;amp; page layouts in the JIT after you ran the &lt;a href="http://blogs.msdn.com/joelo/archive/2006/08/13/697044.aspx"&gt;Warm up scripts&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;PublishAllItems&lt;/strong&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;An extension that will approve items in SharePoint.&amp;nbsp; It has 2 main switches, one to approve "web integrators" libraries (Master pages, Style Library, Site Collection images); and one to approve "Pages" libraries starting a given path and downward.&amp;nbsp; It will also cancel any workflow associated with the element's it's approving.&amp;nbsp; You can also take a look at the one available at &lt;a href="http://stsadm.blogspot.com/2007/08/stsadm-commands_09.html"&gt;http://stsadm.blogspot.com/2007/08/stsadm-commands_09.html&lt;/a&gt; as it ended up being very similar to mine.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;ResetMasterPages&lt;/strong&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;This one I had to create to automate the master pages settings when using Content Deployment.&amp;nbsp; There is a known bug where, when doing the first Full Content Deployment, the master page parameters aren't kept at the destination.&amp;nbsp; This will bring them over.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;ListBuilder&lt;/strong&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;This will read an input Xml file and create custom lists with custom columns.&amp;nbsp; It can also add Lookup site columns and add those columns to content types.&amp;nbsp; This was done because we used Features to add content types but found out that a list was always recreated and used a different GUID.&amp;nbsp; We couldn't provision Lookup columns to them and if we used a Feature to bring a list over, then the GUID was changing every time and causing issues with Content Deployment.&amp;nbsp; It can also provision a BDC column in the list.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;SiteBuilder&lt;/strong&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;This extension will create a whole lot of things for a portal : sites with title/description, content pages with content (fields) values, set master pages, set available page layouts, set the content types per libraries (to fix a little bug), and set security (coming soon).&amp;nbsp; It's great when you have features for the containers/artefacts and you want to add a default&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;AddLocalFile / DeleteLocalFile&lt;/strong&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;We needed a little help to add and remove files other than through Features.&amp;nbsp; Basically, we first had the issue when deploying updates to ItemStyles.xsl and other OOB files.&amp;nbsp; This extension was deleting the OOB files from that web site and then applying the ones from our Feature (and we needed it in ItemStyles and couldn't have a custom file).&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;AddPublishingWorkflow/RemovePublishingWorkflow&lt;/strong&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;This one is in development;I want to be able to add and remove the Publishing workflow for all sites so that we can switch between requiring a "publish" or an "approve" through the extension.&amp;nbsp; We often want publishing only in development but an approval requirement for other environments; this extension would permit this.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;There's also a bunch of custom extensions available by Gary Lapointe at the following address : &lt;a href="http://stsadm.blogspot.com/2007/08/stsadm-commands_09.html"&gt;http://stsadm.blogspot.com/2007/08/stsadm-commands_09.html&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;I'll update this list with blog links when I create them and add new extensions.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Maxime&lt;/p&gt; &lt;p&gt;&lt;embed src="http://card.mygamercard.net/Mumren.swf" width="198" height="135" type="application/x-shockwave-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"&gt;&lt;/embed&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5320345" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/maximeb/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/Web+Content+Management/default.aspx">Web Content Management</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/STSADM+Extensions/default.aspx">STSADM Extensions</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/Variations/default.aspx">Variations</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/Content+Deployment/default.aspx">Content Deployment</category></item><item><title>Listing all sites per variations - an STSADM extension solution</title><link>http://blogs.msdn.com/maximeb/archive/2007/09/24/listing-all-sites-per-variations-an-stsadm-extension-solution.aspx</link><pubDate>Tue, 25 Sep 2007 01:37:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5108077</guid><dc:creator>MaximeB</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/maximeb/comments/5108077.aspx</comments><wfw:commentRss>http://blogs.msdn.com/maximeb/commentrss.aspx?PostID=5108077</wfw:commentRss><description>&lt;p&gt;A little while ago, we ran into an issue with the Variation label creation process; it was ending successfully without creating everything.&amp;nbsp; To make matters worst, it wasn't picking the missing sites/pages with the Synchronization Timer Job.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;So it was very difficult to figure out what was missing in a particular variation except by browsing to each pages and figuring out if the page was missing.&amp;nbsp; While we only had 150 sub-sites, it could create 10 or 140 of them.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;For those interested, it seems that the issue is due to 3 things combined:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Memory leak in the variation creation process (scheduled to be fixed)  &lt;li&gt;Potential memory leak when the farm is on a VMWare virtual environment  &lt;li&gt;Not enough memory on the server :)&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Now, while waiting to have more memory and a fix, we still had to create variations correctly.&amp;nbsp; So far, we could only delete a variation and recreate it while hoping it would be done successfully.&amp;nbsp; In order to assert that we had an incorrect variation label and to what extend, I ended up creating a small STSADM extension that was simply listing each sub-sites in an Xml format along with a counter on each node to mention how many sub-sites is under.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Essentially, create a class that implements ISPStsadmCommand and in the main class, call the EnumSites method passing the output file name &amp;amp; Url.&amp;nbsp; Here's the Visual Basic.NET code excerpt : &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Private&lt;/span&gt; &lt;span style="color: blue"&gt;Function&lt;/span&gt; EnumSites(&lt;span style="color: blue"&gt;ByVal&lt;/span&gt; vOutputFile &lt;span style="color: blue"&gt;As&lt;/span&gt; &lt;span style="color: blue"&gt;String&lt;/span&gt;, &lt;span style="color: blue"&gt;ByVal&lt;/span&gt; vUrl &lt;span style="color: blue"&gt;As&lt;/span&gt; &lt;span style="color: blue"&gt;String&lt;/span&gt;) &lt;span style="color: blue"&gt;As&lt;/span&gt; &lt;span style="color: blue"&gt;String&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Dim&lt;/span&gt; output &lt;span style="color: blue"&gt;As&lt;/span&gt; &lt;span style="color: blue"&gt;String&lt;/span&gt; = &lt;span style="color: blue"&gt;String&lt;/span&gt;.Empty&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Dim&lt;/span&gt; siteMOSS &lt;span style="color: blue"&gt;As&lt;/span&gt; SPSite = &lt;span style="color: blue"&gt;Nothing&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Dim&lt;/span&gt; rootWeb &lt;span style="color: blue"&gt;As&lt;/span&gt; SPWeb = &lt;span style="color: blue"&gt;Nothing&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Dim&lt;/span&gt; publishingRootWeb &lt;span style="color: blue"&gt;As&lt;/span&gt; Publishing.PublishingWeb = &lt;span style="color: blue"&gt;Nothing&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Try&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; siteMOSS = &lt;span style="color: blue"&gt;New&lt;/span&gt; SPSite(vUrl)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rootWeb = siteMOSS.OpenWeb&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; publishingRootWeb = PublishingWeb.GetPublishingWeb(rootWeb)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Dim&lt;/span&gt; xmlDoc &lt;span style="color: blue"&gt;As&lt;/span&gt; &lt;span style="color: blue"&gt;New&lt;/span&gt; XmlDocument()&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Dim&lt;/span&gt; xmlDeclaration &lt;span style="color: blue"&gt;As&lt;/span&gt; XmlDeclaration = xmlDoc.CreateXmlDeclaration(&lt;span style="color: #a31515"&gt;"1.0"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"UTF-8"&lt;/span&gt;, &lt;span style="color: blue"&gt;Nothing&lt;/span&gt;)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlDoc.AppendChild(xmlDeclaration)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Dim&lt;/span&gt; xmlRoot &lt;span style="color: blue"&gt;As&lt;/span&gt; XmlElement = xmlDoc.CreateElement(&lt;span style="color: #a31515"&gt;"Variations"&lt;/span&gt;)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;For&lt;/span&gt; &lt;span style="color: blue"&gt;Each&lt;/span&gt; web &lt;span style="color: blue"&gt;As&lt;/span&gt; PublishingWeb &lt;span style="color: blue"&gt;In&lt;/span&gt; publishingRootWeb.GetPublishingWebs&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;If&lt;/span&gt; web.Label &lt;span style="color: blue"&gt;IsNot&lt;/span&gt; &lt;span style="color: blue"&gt;Nothing&lt;/span&gt; &lt;span style="color: blue"&gt;Then&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Dim&lt;/span&gt; variation &lt;span style="color: blue"&gt;As&lt;/span&gt; XmlElement = xmlDoc.CreateElement(&lt;span style="color: #a31515"&gt;"Variation"&lt;/span&gt;)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Dim&lt;/span&gt; attrSource &lt;span style="color: blue"&gt;As&lt;/span&gt; XmlAttribute = xmlDoc.CreateAttribute(&lt;span style="color: #a31515"&gt;"source"&lt;/span&gt;)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Dim&lt;/span&gt; attrName &lt;span style="color: blue"&gt;As&lt;/span&gt; XmlAttribute = xmlDoc.CreateAttribute(&lt;span style="color: #a31515"&gt;"name"&lt;/span&gt;)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Dim&lt;/span&gt; attrSiteCount &lt;span style="color: blue"&gt;As&lt;/span&gt; XmlAttribute = xmlDoc.CreateAttribute(&lt;span style="color: #a31515"&gt;"numOfSubSites"&lt;/span&gt;)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Dim&lt;/span&gt; numOfSubSites &lt;span style="color: blue"&gt;As&lt;/span&gt; &lt;span style="color: blue"&gt;Integer&lt;/span&gt; = 0&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; attrSource.Value = web.Label.IsSource.ToString&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; attrName.Value = web.Name&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; variation.Attributes.Append(attrName)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; variation.Attributes.Append(attrSource)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output &amp;amp;= &lt;span style="color: #a31515"&gt;"Variation : "&lt;/span&gt; &amp;amp; web.Name &amp;amp; &lt;span style="color: #a31515"&gt;", isSource="&lt;/span&gt; &amp;amp; web.Label.IsSource.ToString &amp;amp; Environment.NewLine&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; numOfSubSites += EnumSites(xmlDoc, variation, web.Web.GetSubwebsForCurrentUser(), output)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; attrSiteCount.Value = numOfSubSites.ToString&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; variation.Attributes.Append(attrSiteCount)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlRoot.AppendChild(variation)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;End&lt;/span&gt; &lt;span style="color: blue"&gt;If&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Next&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlDoc.AppendChild(xmlRoot)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output &amp;amp;= &lt;span style="color: #a31515"&gt;"Saving Xml output file ..."&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlDoc.Save(vOutputFile)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Return&lt;/span&gt; output&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Catch&lt;/span&gt; ex &lt;span style="color: blue"&gt;As&lt;/span&gt; Exception&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output &amp;amp;= &lt;span style="color: #a31515"&gt;"Error : "&lt;/span&gt; &amp;amp; ex.Message &amp;amp; Environment.NewLine&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Finally&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;If&lt;/span&gt; siteMOSS &lt;span style="color: blue"&gt;IsNot&lt;/span&gt; &lt;span style="color: blue"&gt;Nothing&lt;/span&gt; &lt;span style="color: blue"&gt;Then&lt;/span&gt; _&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; siteMOSS.Dispose()&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;If&lt;/span&gt; rootWeb &lt;span style="color: blue"&gt;IsNot&lt;/span&gt; &lt;span style="color: blue"&gt;Nothing&lt;/span&gt; &lt;span style="color: blue"&gt;Then&lt;/span&gt; _&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rootWeb.Dispose()&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;End&lt;/span&gt; &lt;span style="color: blue"&gt;Try&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Return&lt;/span&gt; output&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;End&lt;/span&gt; &lt;span style="color: blue"&gt;Function&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Private&lt;/span&gt; &lt;span style="color: blue"&gt;Function&lt;/span&gt; EnumSites( _&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;ByVal&lt;/span&gt; vXmlDoc &lt;span style="color: blue"&gt;As&lt;/span&gt; XmlDocument, _&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;ByVal&lt;/span&gt; vXmlParent &lt;span style="color: blue"&gt;As&lt;/span&gt; XmlElement, _&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;ByVal&lt;/span&gt; vWebs &lt;span style="color: blue"&gt;As&lt;/span&gt; SPWebCollection, _&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;ByRef&lt;/span&gt; rOutput &lt;span style="color: blue"&gt;As&lt;/span&gt; &lt;span style="color: blue"&gt;String&lt;/span&gt; _&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) &lt;span style="color: blue"&gt;As&lt;/span&gt; &lt;span style="color: blue"&gt;Integer&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Dim&lt;/span&gt; numOfSubSites &lt;span style="color: blue"&gt;As&lt;/span&gt; &lt;span style="color: blue"&gt;Integer&lt;/span&gt; = 0&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Try&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;For&lt;/span&gt; &lt;span style="color: blue"&gt;Each&lt;/span&gt; web &lt;span style="color: blue"&gt;As&lt;/span&gt; SPWeb &lt;span style="color: blue"&gt;In&lt;/span&gt; vWebs&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; numOfSubSites += 1&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Dim&lt;/span&gt; site &lt;span style="color: blue"&gt;As&lt;/span&gt; XmlElement = vXmlDoc.CreateElement(&lt;span style="color: #a31515"&gt;"Site"&lt;/span&gt;)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Dim&lt;/span&gt; attrName &lt;span style="color: blue"&gt;As&lt;/span&gt; XmlAttribute = vXmlDoc.CreateAttribute(&lt;span style="color: #a31515"&gt;"name"&lt;/span&gt;)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Dim&lt;/span&gt; attrWelcomePage &lt;span style="color: blue"&gt;As&lt;/span&gt; XmlAttribute = vXmlDoc.CreateAttribute(&lt;span style="color: #a31515"&gt;"welcomePage"&lt;/span&gt;)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Dim&lt;/span&gt; attrSiteCount &lt;span style="color: blue"&gt;As&lt;/span&gt; XmlAttribute = vXmlDoc.CreateAttribute(&lt;span style="color: #a31515"&gt;"numOfSubSites"&lt;/span&gt;)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; attrName.Value = web.Name&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Try&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; attrWelcomePage.Value = PublishingWeb.GetPublishingWeb(web).DefaultPage.Name&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Catch&lt;/span&gt; ex &lt;span style="color: blue"&gt;As&lt;/span&gt; Exception&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; attrWelcomePage.Value = &lt;span style="color: #a31515"&gt;"N/D --- "&lt;/span&gt; &amp;amp; ex.Message&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;End&lt;/span&gt; &lt;span style="color: blue"&gt;Try&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; site.Attributes.Append(attrName)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; site.Attributes.Append(attrWelcomePage)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Dim&lt;/span&gt; numofSubSubSites &lt;span style="color: blue"&gt;As&lt;/span&gt; &lt;span style="color: blue"&gt;Integer&lt;/span&gt; = EnumSites(vXmlDoc, site, web.GetSubwebsForCurrentUser, rOutput)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; numOfSubSites += numofSubSubSites&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; attrSiteCount.Value = numofSubSubSites.ToString&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; site.Attributes.Append(attrSiteCount)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vXmlParent.AppendChild(site)&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Next&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Catch&lt;/span&gt; ex &lt;span style="color: blue"&gt;As&lt;/span&gt; Exception&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rOutput &amp;amp;= &lt;span style="color: #a31515"&gt;"Error : "&lt;/span&gt; &amp;amp; ex.Message &amp;amp; Environment.NewLine&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;End&lt;/span&gt; &lt;span style="color: blue"&gt;Try&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;Return&lt;/span&gt; numOfSubSites&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;End&lt;/span&gt; &lt;span style="color: blue"&gt;Function&lt;/span&gt;&lt;/p&gt;&lt;/div&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;You can essentially do the same for pages if you want to list them and do a compare with the source variation in order to list exactly what's missing, however, when we found out that the memory was the issue, we didn't extend this application so it's still in the "napkin format" :)&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Maxime&lt;/p&gt; &lt;p&gt;&lt;embed src="http://card.mygamercard.net/Mumren.swf" width="198" height="135" type="application/x-shockwave-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"&gt;&lt;/embed&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5108077" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/maximeb/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/Web+Content+Management/default.aspx">Web Content Management</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/STSADM+Extensions/default.aspx">STSADM Extensions</category><category domain="http://blogs.msdn.com/maximeb/archive/tags/Variations/default.aspx">Variations</category></item></channel></rss>