Welcome to Office Zealot Sign in | Join | Help

Ever wonder how to add entries to the Portal Log?  Well, you can do this the easy way by using Microsoft.Office.Server.Diagnostics.PortalLog.LogString but there always seems to be those cases where you want more flexibility than just adding a basic message to the logfile.  For example, you may want to flag things as Information or maybe change the application name for your entries to make it easier to search for them in the log file...

I came across an great example of doing just that, see the link below.

SharePoint Logging and Microsoft’s Trace Log Provider at trentacular

To deploy IMM, one of the prereq's is to .NET Framework 3.5 SP1... we had done this on two different dev servers with no ill effects.  However, turns out in production, there is a slight side effect that was causing us some major problems.  The main difference between the two environments is that production has 3 front ends and is therefore load balanced while dev is a stand alone server.

After applying the service pack, we did verify on all systems that the MOSS sites were loading properly.  However, in a load balanced environment, we found that the web services were now returning a 401 unauthorized error message.  To further verify the problem, I tested the following scenarios:

  • Dev (standalone) - web services worked properly
  • Prod with a load balanced url - web services failed
  • Prod with a non-load balanced url - web services worked properly.

Apparently. 3.5 SP1 adds a loopback security check feature that is designed to help prevent reflection attacks... this makes authentication fail if the FQDN or host header does not match the local computer name.

Resolution:

MSKB 896861
This KB article defines the problem in a slightly different way (Windows XP SP 2 or Windows 2003 SP1) however the solution is the same... basically add a registry key to disable the loopback check and reboot.  This fixed our problem and web services worked properly once again. 

Below are the steps the article outlines...

Method 1: Disable the loopback check
Follow these steps:
  1. Click Start, click Run, type regedit, and then click OK.
  2. In Registry Editor, locate and then click the following registry key:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa

  3. Right-click Lsa, point to New, and then click DWORD Value.
  4. Type DisableLoopbackCheck, and then press ENTER.
  5. Right-click DisableLoopbackCheck, and then click Modify.
  6. In the Value data box, type 1, and then click OK.
  7. Quit Registry Editor, and then restart your computer.
0 Comments
Filed under: , ,

I am building some web parts that include some AJAX functionality and found out that any inline scripts I was outputting in my updatepanel were not being executed.  The blog post below offers a great explanation on this... basically, use ScriptManager.RegisterStartupScript with your updatepanel control to add scripts that should be executed when the panel loads.

Inline Script inside an ASP.NET AJAX UpdatePanel - Infinities Loop

Something has been brought to my attention today that I wanted to share... most people use elevated privileges but don't pass the user token... check out this post for more info.

Daniel Larson's Developer Blog: SharePoint Elevated Privilege without RunWithElevatedPrivelege

0 Comments
Filed under:

Recently I was asked how we could show and hide things based on user permission, without writing a custom MOSS feature with c# code.  There are a couple ways to do this and rather than me spending type typing up a how to or show examples, I've looked up a couple examples other people have provided on the net:

SPSecurityTrimmedControl - specify what permissions are needed to show the items wrapped in this control.  The blog post below explains this pretty well and shows you all the available permissions you can use.  Notice that at the bottom of the post, the author included a code example.

An example of using this would be to hide the Site Actions menu for everyone who does not have permission to AddAndCustomizePages and ManageLists... in other words, do not show the site actions menu for users who are visitors or contributors.

Referenced blog post - http://zac.provoke.co.nz/archive/2007/05/31/spsecuritytrimmedcontrol-possible-values-for-permissionsstring.aspx

MenuItem PermissionsString - specify what permissions are needed to show the current menu item.  The blog post below documents this pretty well and shows a very good example for hiding 'edit page' from the site actions menu using this method.

Referenced Blog Post - http://www.sharepointblogs.com/holliday/archive/2008/01/14/hide-edit-page-in-site-actions-menu.aspx

1 Comments
Filed under: ,
More Posts Next page »