About      |       Articles      |      Services      |      Software      |      Contact

Latest Free SharePoint Software

ARB Security Solutions regularly releases free SharePoint software, including WebParts, Client Applications, Framework Extensions, and other Miscellaneous Components.
The most recent freeware is:

Title: Simple SharePoint Rollup WebPart
Date Published: 10/22/2009

Previous Two Free WebPart Releases:

SecureCenter For SharePoint

By SharePoint security integrators, for SharePoint security integrators.

SharePoint Security Assurance Program™

For externally facing SharePoint deployments, security is an acutely important deployment concern. Learn how through daily security scanning, you can ensure external business users and partners that they can collaborate in confidence!

Security Assurance WebPart:



Return IIS Settings For A SP Zone

There was a question in the SharePoint development newsgroups as to how someone might go about getting specific IIS settings when wanting to target an arbitrary SharePoint zone from which to query those settings. Fortunately, within the SharePoint object model, this is feasible using the GetIisSettingsWithFallBack method out of SPWebApplication. For example, this method is helpful when you want to retrieve something like a file that exists at the root of your SharePoint web application. For example, let's write a small example method that will allow us to harness the web.config file for an arbitrary zone, which we will specify using the SPUrlZone enumeration. The SPUrlZone enumeration contains all the neccesary member values for working with the zones as they exist within your SharePoint instance, including custom, default, extranet, internet, and intranet. In this case, let's start with something simple, namely the default member. Let's start off this method by declaring a simple field, just an empty string, and within the parameters of the method, lets pass in a SPWebApplication object so that we can call the required methods.

C#:
  1. private void UsingGetIisSettingsWithFallBack(SPWebApplication myWebApplication)
  2. {
  3. string filename = string.Empty;
  4. }

Now that we have a small string field setup to hold the value, we can use the GetIisSettingWithFallback in order to harness the web.config by specifying the default zone, and then getting the full path to the required file.

C#:
  1. private void UsingGetIisSettingsWithFallBack(SPWebApplication myWebApplication)
  2. {
  3. string myReturn = string.Empty;
  4. myReturn = myWebApplication.GetIisSettingsWithFallback(SPUrlZone.Default).GetPath().FullName + @"\web.config";
  5. }

And that's it! If you wanted to take it a step further, you can declare a new XmlDocument object in order to hold the string value. You can do this by simply instantiating said object, and then use the load method out of XmlDocument (in combination with an SPWebConfigModification object, which you should just pass in as a parameter), like this:

C#:
  1. private void UsingGetIisSettingsWithFallBack(SPWebApplication myWebApplication)
  2. {
  3. string myReturn = string.Empty;
  4. XmlDocument myDocument = new XmlDocument();
  5.  
  6. myReturn = myWebApplication.GetIisSettingsWithFallback(SPUrlZone.Default).GetPath().FullName + @"\web.config";
  7. document.Load(myReturn);
  8.  
  9. }

Which will really let you start with the fun stuff!

  • Share/Bookmark

2 Comments »

  1. [...] There was a question in the SharePoint development newsgroups as to how someone might go about getting specific IIS settings when wanting to target an arbitrary SharePoint zone from which to query those settings. Fortunately, within the SharePoint object Read More……(read more) October 07th 2007 Posted to Uncategorized [...]

    Pingback by Blogger Loser » Return IIS Settings For A SP Zone — October 7, 2007 @ 2:05 pm

  2. [...] Return IIS Settings For A SP Zone [...]

    Pingback by Links (10/7/2007) « Steve Pietrek’s SharePoint Stuff — October 7, 2007 @ 5:20 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment