Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Programatic Administrative Functions

  Asked By: Ashu    Date: May 29    Category: Sharepoint    Views: 769

I'd like to keep track of all the code I apply to my SharePoint farm, so
if I ever had to apply them again, it would be very quick and simple.

As I customize our sharepoint deployment, I have learned that I can, of
course write features in XML to define columns, content types etc, and
that XML will allow me to create site definitions.

I've always seen this as the primary way of customizing a farm, but I
keep reading about ways in C# to programatically change things.


"Designating a Records Center Site"

SPWssWebApplication app = SPGlobalAdmin.AdministrationWebApplication;
app.officialFileUrl = "url";

app.officialFileName = "description";


So would you create this as a console application and run it from the
command line? Would you build it as a feature and the change occurs on

Another example is that you can programmatically push down changes in
parent content types to that content type's children. I am not aware if
this is more effective than creating a feature for a content type in
XML, and then changing the feature XML to redeploy changes. (does
activatefeature push down changes in content types to that type's
children?) If C# is the right way to apply these changes, I probably
need a base feature in XML, and then subsequent changes should be done
in C#. I would like to pair these solutions together.

What are best practices for change management when you use something
like this? I currently have a repository of all my XML features, how do
you retain and track changes like this in the case that you need them
for disaster recovery? What is the easiest way to automate the
application of things like this farm wide?



1 Answer Found

Answer #1    Answered By: Fabian Gross     Answered On: May 29

You can always right the code  to run  based on the activation event of a
Feature Event handler and then load the code as a Feature. This
documents it and allows you to turn the code on by activating the
feature. You can also build  code to back the results out if the feature
is deactivated. That way applying your change  or rolling it back is
part of the same feature.

Didn't find what you were looking for? Find more on Programatic Administrative Functions Or get search suggestion and latest updates.