DotNet Development, SharePoint Customizing, Silverlight, MS Infrastructure and other tips and tricks

Posts Tagged ‘Infrastructure’

Dual Authentication Providers in SharePoint 2007

Posted by PANVEGA on March 17, 2009

In a production environment, I would opt to install both on to a machine even though it will be primarily Internet\Extranet facing, even if it is using the local directory services.  This gives a backdoor to managing the site should you have problems with the forms authentication mechanism (or other).

In order having many different third party authenticatin providers for your SP application you can solve this problem in SharePoint 2007. In the new version different authentication providers are supported. In fact, different providers can be used together for the same site! A major improvement which will make a lot of people very happy.

A single web application only supports a single authentication provider, such as Windows, Forms, etc. That mean, you can not use one application (Domain namsepace) for 2 or more authentication providers. Read the rest of this entry »

Posted in Administration, ASP.NET, IIS, Infrastructure, MOSS, Security, SQL | Tagged: , , , , , | 2 Comments »

Using Google Analytics with SharePoint

Posted by PANVEGA on March 14, 2009

One of my clients wants to use Google Analytics (GA) for their SharePoint (MOSS 2007) intranet. GA is a web analytics package provided free by Google.  You sign up plug some JavaScript into your site (provided to you during the sign up process).

Thanks to the way SharePoint 2007 uses master pages, it’s a breeze to hook it up.  I’m using GA for multiple sites, some are SharePoint 2007 WCM sites and some are not.  As you know, SharePoint already has some built in usage analysis capabilities and they are pretty good.  GA extends these capibilities and provides a more common interface and set of tools for slicing your web site usage data.

There’s some good information out there about how to set this up, but I wanted to clarify a few points in the hope of saving others some time.

The basic steps are:

  1. Obtain the Fully Qualified Domain Name (FQDN) for your MOSS site.
  2. Create your Google Analytics account (see detail below). FYI, You don’t need to pass any authentication in order to track hits to your site.
  3. Add the GA tracking code to your site’s master page within the HTML Body tags, which will allow you to analyze all the sub-pages, not just the home page.
  4. If you doo not have the right permissions to change the masterpage just add a WebEditor Webpart into your ASPX page and copy the JS code into it. Make the Webpart invisiblefor users by setting the Crometype to none Read the rest of this entry »

Posted in Infrastructure, JavaScript, MOSS | Tagged: , , , , | 1 Comment »

SharePoint using a Warm Up Script

Posted by PANVEGA on November 13, 2008

Ever had to wait a long time before a SharePoint page loads the first time? You really want to have the pages load fast if you click through a SharePoint page. When I hit my SharePoint site it takes 30 seconds to load, then after a refresh it goes sub second, even clearing their cache the page is fast.

Why is that so slow?

So, the curse of the .NET web applications (and then some blessing) is the JIT that impacts the performance for the first -unfortunate- user to access the application first time in the morning, or just after an inconsiderate administrator/developer installed something on the server.

Read the rest of this entry »

Posted in Administration, Infrastructure, MOSS | Tagged: , , | 2 Comments »

How to access the MOSS UserProfile through the ProfileManger

Posted by PANVEGA on November 7, 2008

To those doing software development for a Sharepoint environment, user profiles can be a mysterious and confusing area. This post will detail some of the basics, and outline some snafoos you may run into if you find yourself doing software development that interacts with the Sharepoint user profile information.

First, it should be explained that the user profile setup differs depending on whether you are operating in a full MOSS environment, or simply using the basic WSS structure. In the full MOSS environment, user profile information is stored in a central database, and profile information is shared across site collections that may be hosted on your server. This profile info can be read and/or edited via the UserProfileManager class within the Microsoft.Office.Server dll.

Read a little deeper about Profiles administration in more in one of my previous posts

Read the rest of this entry »

Posted in Administration, Field Types, Infrastructure, MOSS | Tagged: , , , | 1 Comment »

Introduction to User Properties in the SP Central Administration

Posted by PANVEGA on November 5, 2008

User profile properties define a portal user’s individuality. These properties store all essential information, such as contact details, distribution list memberships and colleagues. All can be retrieved from Active Directory and LDAP; from external data sources such as databases and legacy applications; and through the use of the Business Data Catalog (BDC) or from the SharePoint Profiles data store itself.

User profile properties are not limited to those that are created by default during the creation of the Shared Services Provider. Custom profile properties can be created in SharePoint and mapped to AD properties to accommodate situations when Active Directory is being used to track all possible information about a user. But they can be maintained independently of the AD account properties as well.

The set of properties that are included in the user profile might not contain all of the information about users in your organization that you want to include on the site. You can add new properties to enhance those included in the user profile.

You can also edit existing properties to change how those properties are displayed in the user profile.

You can also map properties to properties in Active Directory directory services.

Note When you add or edit a property mapping, you must run a full import before the changes take effect.

My Scenario:

I created a custom people picker field type, where I should retreive some User Properties into a SP List. By default only some fileds are shown in the PickerEntity properties. Hence I have to map some new fields to the user profile through the AD and have to make a full import after the changes (MOSS way). Down below I explained it a little deeper.

Read the rest of this entry »

Posted in Administration, Field Types, Infrastructure, MOSS | Tagged: , , | Leave a Comment »

Updating Files after IIS Application Pool Recycling

Posted by PANVEGA on October 21, 2008


Sometimes you have to update some files in you SharePoint 12 Folder. However it is not always possible updating files while someone access the application file. You can only access via read permission.

I have a custom webpart that accesses some XML files. However the XMLs should be updated via Webservice once a day.

Read the rest of this entry »

Posted in Administration, IIS, Infrastructure, MOSS, WebParts | Tagged: , , , , | Leave a Comment »

IIS HTTP Compression

Posted by PANVEGA on September 22, 2008

There’s a finite amount of bandwidth on most Internet connections, and anything administrators can do to speed up the process is worthwhile. One way to do this is via HTTP compression, a capability built into both browsers and servers that can dramatically improve site performance by reducing the amount of time required to transfer data between the server and the client. The principles are nothing new — the data is simply compressed. What is unique is that compression is done on the fly, straight from the server to the client, and often without users knowing.

In the day of IIS5 and earlier the compression built into IIS had various issues and was really not worth implementing. To enable compression you would need to go with a 3rd party solution like or This has all changed in IIS6!

Read the rest of this entry »

Posted in IIS, Infrastructure, MOSS, Uncategorized | Tagged: , | Leave a Comment »

Deploy dlls to the webApplications bin rather than GAC

Posted by PANVEGA on May 14, 2008

Background information

Let’s first discuss some topics related to the GAC. The GAC is the centralrepository for assemblies which are installed on a Windows machine (including all important .NET system assemblies implementing the Framework Class Library). By the way, all assemblies which are stored in the GAC must be strong named.

The primary purpose of the GAC is to eliminate problems of sharing DLL code. There are several ways to interact with the GAC, for instance via the gacutil tool or ShFusion.dll, which is a Windows Explorer shell extension that provides a user-friendly interface to the GAC.

Read the rest of this entry »

Posted in Deployment, Infrastructure, MOSS | Tagged: , , | 2 Comments »

Asynchron Webservice call with XMLHttpRequest

Posted by PANVEGA on February 12, 2008

XMLHttpRequest is a JavaScript object that was created by Microsoft and adopted by Mozilla. You can use it to easily retrieve data via HTTP. Despite its name, it can be used for more than just XML documents, e.g. for JSON.

As deployment of XML data and web services becomes more widespread, you may occasionally find it convenient to connect an HTML presentation directly to XML data for interim updates without reloading the page. Thanks to the little-known XMLHttpRequest object, an increasing range of web clients can retrieve and submit XML data directly, all in the background. To convert retrieved XML data into renderable HTML content, rely on the client-side Document Object Model (DOM) to read the XML document node tree and compose HTML elements that the user sees.

History and Support

Microsoft first implemented the XMLHttpRequest object in Internet Explorer 5 for Windows as an ActiveX object. Engineers on the Mozilla project implemented a compatible native version for Mozilla 1.0 (and Netscape 7). Apple has done the same starting with Safari 1.2.

Similar functionality is covered in a proposed W3C standard, Document Object Model (DOM) Level 3 Load and Save Specification. In the meantime, growing support for the XMLHttpRequest object means that is has become a de facto standard that will likely be supported even after the W3C specification becomes final and starts being implemented in released browsers (whenever that might be).

Using XMLHttpRequest is very simple. You create an instance of the object, open a URL, and send the request. The HTTP status code of the result, as well as the result document are available in the request object afterwards.Some simple code to do something with data from an XML document fetched over the network:

function test(data) {
 // taking care of data

function handler() {
 if(this.readyState == 4 && this.status == 200) {
  // so far so good
  if(this.responseXML != null && this.responseXML.getElementById('test')
     // success!
 } else if (this.readyState == 4 && this.status != 200) {
  // fetched the wrong page or network error...

var client = new XMLHttpRequest();
client.onreadystatechange = handler;"GET", "test.xml");

If you just want to log a message to the server:

function log(message) {
 var client = new XMLHttpRequest();"POST", "/log");
 client.setRequestHeader("Content-Type", "text/plain;charset=UTF-8");

Or if you want to check the status of a document on the server:

function fetchStatus(address) {
 var client = new XMLHttpRequest();
 client.onreadystatechange = function() {
  // in case of network errors this might not give reliable results
  if(this.readyState == 4)
 }"HEAD", address);

 Read the rest of this entry »

Posted in AJAX, Infrastructure, JavaScript | Tagged: , , , , , | Leave a Comment »

Modify a XSN InfoPath by using makecab command

Posted by PANVEGA on January 5, 2008

Sometimes you have to change manually any files for e.g. the .xsd schema in a InfoPath XSN file. But how can you build extracted XSN files back to a XSN formular? In this article I will show you how to realzie that.But before I give you some imformation about this unknown format.

Read the rest of this entry »

Posted in InfoPath, Infrastructure | Tagged: , , | 4 Comments »

IIS Redirection for SharePoint Sites

Posted by PANVEGA on November 30, -0001

I (of our SPS instance) wanted to redirect an old list to a new list. I did not want to create a code-based solution (e.g. an aspx page, et al) and with the friendly “Apache could do this”. I decided to see if IIS would handle it.


When a browser requests a page or program on your Web site, the Web server locates the page identified by the URL and returns it to the browser.

When you move a page on your Web site, you can’t always correct all of the links that refer to the old URL of the page. To make sure that browsers can find the page at the new URL, you can instruct the Web server to redirect the browser to the new URL.

You must be a member of the Administrators group on the local computer to perform the following procedure or procedures.

You can redirect requests for files in one directory to a different directory, to a different Web site, or to another file in a different directory. When the browser requests the file at the original URL, the Web server instructs the browser to request the page by using the new URL.

SharePoint URLs can get long and unmanageable and admins want URLs that their users can remember. They want to use something like http://sharepoint forward to http://sharepoint/_layouts/authenticate.aspx

To do this kind of redirection I use IIS directly, I don’t get SharePoint involved at all. Create a new virtual server in IIS Manager and give it a descriptive name like “Software Redirect.” When you’re walking through the wizard you’ll take the defaults. You’ll have to point it to a local directory. This is only temporary, so you can point it anywhere. After the virtual server is created, edit the properties. Open the “Home Directory” tab and click “A redirection to a URL” then type your SharePoint URL in the “Redirect to:” box.

  1. On the filesystem in your webroot, create a folder structure mimicking the URL
  2. Open IIS Management console and locate that folder
  3. Right-click on that folder and select properties
  4. Use the “A redirection to a URL” option in the Directory tab
  5. Enter the new URL (absolute OR relative) in the Redirect To: box
  6. Test it

All other sites in that path should remain untouched by IIS but since IIS processes this redirection prior to running the ISAPI filter/extension (e.g. SharePoint) then there is no need to even unmange this path from within SharePoint itself.

Server variables

You can configure redirection to a URL and wildcard redirection programmatically. Redirection variables and flags allow you to specify targets and behavior by changing the HttpRedirect metabase property.

The following example shows the format of a simple redirection string.


Where DestinationURL can include the following redirect variables to pass portions of the original URL with the destination URL. You can use more than one variable in a single redirection string.


Two changes should jump out at you. First, the URL ends in $V$Q. The $V represents the original URL the user is trying to access, but without the protocol, servername or parameters. The $Q represents any parameters the URL included. Here’s a crude drawing of how the URL breaks down: redirect to http://servername$V$O

Redirect possibilities:

Here are all the redirection possibilities that I can think of right now, categorized by the type of redirection performed, technology used to perform the redirection, and amount of coding involved. Get ready for this index to be updated with links…

  • Client-Side Redirection using:
    • IIS “Core” (no code) – HttpRedirect
    • IIS “Core” (script code) – HttpErrors and ASP
    • ASP (script code) – Response.Redirect
    • ISAPI Filter (compiled code) – SF_REQ_SEND_RESPONSE_HEADER
  • Server-Side Redirection using:
    • IIS “Core” (no code involved) – IIsWebFile and ScriptMaps
    • ASP (some code involved) – Server.Transfer and Server.Execute (ASP only)
    • ISAPI Filter (compiled code) – SetHeader( “url” ) in SF_NOTIFY_PREPROC_HEADERS or SF_NOTIFY_AUTH_COMPLETE
    • ISAPI Extension (compiled code) – HSE_REQ_EXEC_URL and HSE_REQ_EXEC_UNICODE_URL and Wildcard Application Mapping
  • Server-Side Forwarding using:
    • ISAPI Filter (compilied code) – Using WinHttp
    • ISAPI Extension (compiled code) – Using WinHttp and Wildcard Application Mapping

More Information:

Posted in IIS, Infrastructure, MOSS | Tagged: , , | Leave a Comment »