in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

Bobby Habib SharePoint & MOSS Blogging Space

Bobby Habib - My findings on SharePoint / MOSS, Web Part Developments, etc. Information I think will help the SharePoint Community. All posts are provided "AS IS" with no warranties, and confers no rights. Whats the bloody Point!
  • Leveraging the Object Cache, but there are considerations from a development perspective

    One of the most simplest and effective ways to speed up your portal page loads is to leverage the Object Cache for MOSS, which comes as part of the product Out of the box. This settings can be modified in the SharePoint site : Site Actions > Modify All Site Settings > Object Cache Settings.

    So what does this give you?

    We all know that MOSS practically stores everything in its SQL database, so this could prove to be expensive from a networking perspective and can put heavy load on the SQL server, so this is where the object cache mechanism can take advantage on objects (Content) that are commonly requested. For example the Navigation control, most pages would have a navigation control embedded into a MOSS page, by storing these common objects to disk, will  reduce the number of server hops required to be hit on the SQL Server decreasing page load time.

    Sounds like a great way to speed up MOSS page loads.But when we get out of the arena of Out of the Box controls and jump into the land of customization, then the Object Cache settings can make or break the page load times. Confused?OK we need to dig a little deeper to get my point across.OK, let me give you an example; one of the ways to create a custom navigation control or a site map of your site structure would be to iterate through your sites and build up a control dynamically using something like the PortalSiteMapProvider class that is provided to you in the Microsoft.SharePoint.Publishing assembly.

    Sounds about right. Big Smile

    But what happens if you have something like 500+ subsites. I have seen companies having 5000 + subsites, but wait we would probably leveraging the Object Cache, as the PortalMapSiteProvider uses the CacheObject interfaces instead of the actual SPWeb objects.

    But it still needs to build the cache the first time. If we look at the behavior of the PortalSiteMapProvider class, when we parse the map, a SPWeb object is cached for each node.

    If let’s say for arguments sake each node consumes about 1mb  per node and our object cache size is only set to 100mb, if we have a large site structure and we come to the 101 node, the oldest object will be removed from the cache to allow for the latest node to be cached. If we had 500 nodes (sub-sites) only the latest 100 nodes will be cached and the remaining 400 nodes would have been stored in the cache and then removed making the object cache completely in-efficient, as the next request will have to rebuild all this again, causing really slow page loads and no benefit of the object cache, as what is now stored in the object cache is useless pile of muck. Embarrassed

    We will also fill up unnecessary memory causing w3wp.exe to run inefficiently.  Also we end up with a high number of SPWeb objects being left open waiting for the most reliable [not] .Net Garbage Collector to free up its memory resource, because the objects are not disposed by design and if you are not careful with Verbose logging ramped up, you probably will end up with GB’s of ULS logs in MOSS in minutes, eating valuable disk space, depending on your log settings.

    So what can we do to improve this, well we have a few choices:

    1.       You can consider increasing the objects cache size, when it comes to a huge number of objects, start from 500MB, test and move up from there, tweaking the object cache size. Obviously, this will require your system to have an important RAM size, or will push you towards 64-bit if you are not already there.

    2.    Develop a navigation control to read an .xml file that can be updated through a custom windows or custom timer job, for example every 15mins. This type of solution does not provide a page to be visible until the xml file has been updated.

    3.    Develop your own provider, with another cache mechanism for instance caching the nodes and not the SPWeb objects.

            The morale of this blog is when considering using the Object Cache; take into consideration the customization you may have implemented in your MOSS environment and the way the customization has been developed. If these considerations have not been considered and your development is leveraging the Object Cache interfaces you could have an adverse reaction to what you trying to achieve.

     
  • Applying Version 2 patch for MOSS PortalSheild for WSS 3.0

    ISSUE: 

    After applying Version 2 patch of Portalshield for WSS 3.0, you my see the following error:

     

    • Event ID 3351 - SQL database login failed. Additional error information from SQL Server is included below.    Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'

    • Event ID 1000 - (#50070 "Unable to connect to the database "<database name>" on "<remote SQL server name>")

    These error may occur every 5 mins in your event logs.

    FIX:

    Run the SETSQLACT tool at the command prompt to select the appropriate account:

    1. Click Start, Run, type cmd click OK.
    2. At the prompt, type the appropriate command below and press ENTER: 

      CD \Program Files\Network Associates\McAfee PortalShield\bin (For PortalShield 1.x installations)

      CD \Program Files\McAfee\McAfee PortalShield\bin (For PortalShield 2.x installations)

    3. Type the following command and press ENTER: 

      SETSQLACT.EXE 

    4. Type the name of the account that has access to the remote database and is a member of the Local Administrators group and press ENTER.

    Keep this command session open as it will be used later in this procedure.

    Modify the registry:

    1. Click Start, Run, type regedit and click OK.
    2. Navigate to and select the appropriate registry key below:

      HKEY_LOCAL_MACHINE\Software\Network Associates\McAfee PortalShield (For PortalShield 1.x installations)

      HKEY_LOCAL_MACHINE\Software\McAfee\McAfee PortalShield (For PortalShield 2.x installations)

    3. In the right pane, click Edit, New, DWORD value.
    4. Name the new DWORD value ODForceImpersonate and set the Value data to 1.
    5. Close Regedit.

    At the command prompt:

    1. Type the command below and press ENTER to restart Microsoft IIS:

       IISRESET 

    2. Wait for the prompt stating Internet services successfully restarted, then close the command session.

    Restart the PortalShield service:

    1. Click Start, Settings, Control Panel, Administrative Tools, Services.
    2. Right-click the McAfee PortalShield service and select Restart.
    3. Close the Services window.

     

    This fix was initially used to fix the same issue in PortalShield for WSS 2.0, I came across the same problem for PortalShield for WSS 3.0 after applying Version 2 patch and the same fix resolved my issue for MOSS. The fix is listed on the Macfee site but only references PortalShield for WSS 2.0.

    Mcafee

    Smile 

     

  • Using the Outlook Web Part and User Credentials

    How do we get the OWA Web Part to work without prompting you to add user credentials and to autodetect the user without prompting for a password?

    Hmmm...Interesting. Hmm 

     The best workaround I have seen for this so far is to set up x2 web sites on your OWA server. One web site can be configured with FBA [Forms Basic Authentication] or Basic Authentication [mail.yourcompany.com] which is used for primary OWA use within your organization and the other web site [spmail.yourcompany.com] is configured with Windows Authentication which is used for just SharePoint web part usage.

     Using the windows authentication site [spmail.yourcompany.com] within your web part will automatically log the user onto the OWA server without re-prompting for the password.

    Makes sense when you think about it. Confused 

     

     

  • Different type of MOSS caching mechanisms ?

    SharePoint 2007 has a caching features built into itself to speed up the performance of site rendering, but does not do content synching or content replication. MOSS 2007 uses ASP.NET 2.0 caching options as well as caching functionality that the Office team designed specifically for MOSS.

    The types of caching are:

    Type:       Output Caching and Cache Profiles
    Cache At: Individual page level
    Note:        Includes extending caching using VaryByCustomString
     
    Type:       Object Caching
    Cache At: Individual Web Part control, field control, and content level
    Note:        Includes cross-list query caching and navigation caching
     
    Type:       Disk-based Caching for Binary Large Objects
    Cache At: Individual binary large object (BLOB) level and caches images, sound, movies, and code
    Note:        Supports .gif, .jpg, .js, .css, and other image, sound, and code files that are stored as binary large objects
     

    Procedures for Output Caching and Cache Profiles

    Pros and Cons of Output Caching
    Before choosing to use output caching to improve the performance of page and page-item rendering, consider benefits and drawbacks of a potential output caching implementation. All considerations are not listed in this document, but some benefits you may want to consider include:

    Each equivalent class of content (such as page or item within a page) receives faster response, and therefore shorter latency, after it is initially rendered.

    Each server uses less CPU time and energy to serve the same page after the initial rendering.

    Each data source for the rendered page can scale to serve more Web clients because of the decreased traffic flow that output caching makes possible.

    For each page request for which an output cached version of a page is served, the server does not have to:

    Make a round trip to the database to fetch the source code for the .aspx page and any .ascx controls on the page.

    Reload and re-render the controls.

    Requery any data sources that the controls rely on for data.

    However, before deciding to implement output caching, you may want to consider the following concerns:

    Output caching consumes additional memory. Each version of a page consumes memory on the Web client.

    When used with two or more front-end Web servers, output caching may affect consistency. You can configure a cache profile not to check for updates for each request and, for example, instruct it to ignore changes to the version of the Web page in the output cache until 60 seconds after the original page is updated. If you have two front-end Web servers in your topology, and depending on the load balancer used to route the user's request, a reader of site content could see inconsistency if the page is rendered by one server and then a subsequent request is routed to a second server within that 60-second window.

    Cache Profiles
    Office SharePoint Server 2007 adds a more precise mechanism for customizing output caching than those available natively in ASP.NET 2.0. Office SharePoint Server 2007 includes cache profiles, which are list-style cache settings that you can name and apply to pages, page items, content types, and levels of scale in your site deployment.

    By using cache profiles, you can control the level of granularity applied to output caching; allow or disallow site owners and administrators to choose their own cache profiles and apply them flexibly to page layouts; and target output caching at the site collection, site, and page layout levels.

    You can organize caching behavior based on a user's access rights to a site. For example, you may have three groups defined: one with full control, one with read and write rights, and one with read-only rights. Output caching renders the page the same way for users with the same rights, so you can use cache profiles to target caching to specific audience groups. In the cache profiles that Office SharePoint Server 2007 delivers by default, the caching system renders the page once per group of user access rights and then caches the resulting HTML stream. The next user with the same access rights gets the stream from the cache.

    After you create and deploy a cache profile, any change to the cache profile immediately affects all applicable content on the site. For example, if all document library page layouts in a given site collection are initially cached for 60 seconds, and you increase that duration to 120 seconds, every document library page layout in that site collection is cached for 120 seconds regardless of the number of document library page layouts or sites in the site collection.

    You can define a cache profile by using the cache profile stored in a standard Office SharePoint Server 2007 list, and extend it programmatically by using a VaryByCustom handler. If you apply the cache profile to the site and page layout through the user interface, down-level propagation enforces consistency in child sites. Cache policy is secured independently from other Office SharePoint Server 2007 features.

     

    To enable output caching for a site collection
    Navigate to the root Web site of the site collection. On the Site Actions menu, click Site Settings.

    In the Site Collection Administration section, select Site collection output cache.

    To enable output caching for this site collection, select Enable output cache.

    Choose a cache profile for anonymous users from the Anonymous Cache Profile list. This profile is applied when anonymous users access a site in this site collection.

    Choose a cache profile for authenticated users from the Authenticated Cache Profile list. This profile is applied when authenticated users access a site in this site collection.

    Choose Page Output Cache Policy options.

    If publishing sites can use a different output cache profile, select Publishing sites can use a different page output cache profile.

    If page layouts can use a different output cache profile, select Page layouts can use a different page output cache profile.

    If you want to display additional cache information on pages in this site collection, including the date and time that page contents were last rendered, select Enable debug cache information on pages.

    Click OK.

    To enable output caching for a site
    Navigate to the root Web site of the site collection. On the Site Actions menu, click Site Settings.

    In the Site Administration section, select Site output cache.

    Choose an Anonymous Cache Profile option:

    If you want to inherit a cache profile, click Inherit the profile.

    If you want to choose a cache profile from those currently available, select Select a page output cache profile.

    If you want to apply these settings to all subsites of this root Web site, select Apply these settings to all sub-sites.

    Click OK.

    To create a new cache profile
    Navigate to the root Web site of the site collection. On the Site Actions menu, click Site Settings.

    In the Site Collection Administration section, select Site collection cache profiles.

    Click New.

    Define and create a new cache profile.

    Detail Description

    Title

    Required. The system name of this cache profile.

    Display Name

    Populates the list of available cache profiles for site owners and page layout owners.

    Display Description

    Populates the list of available cache profiles for site owners and page layout owners.

    Perform ACL Check

    Select to ensure that all items in the cache are security trimmed.

    Enabled

    Select if you want caching to happen.

    Duration

    Number of seconds to keep the cached version available.

    Check for Changes

    Select to validate on each page request that the site has not changed and to flush the cache when the site changes.

    Clear if you want better performance. If unchecked, system does not check for updates to sites for the number of seconds specified in Duration.

    Vary by Custom Parameter

    Specify a value as described in the ASP.NET 2.0 HttpCachePolicy.SetVaryByCustom method documentation.

    Vary by HTTP Header

    Specify a value as described in the ASP.NET 2.0 HttpCachePolicy.VaryByHeaders property documentation.

    Vary by Query String Parameters

    Specify a value as described in the ASP.NET 2.0 HttpCachePolicy.VaryByParams property documentation.

    Vary by User Rights

    Select to ensure that users must have identical effective rights on all SharePoint security scopes to see the same cached page as any other user.

    Cacheability

    Choose a value from the drop-down list. Choices include NoCache, Private, Server, ServerAndNoCache, Public, and ServerAndPrivate. To learn more, see the ASP.NET 2.0 HttpCacheability enumeration topic.

    Safe for Authenticated Use

    Select only for policies that you want to allow administrators and page layout designers to apply to authenticated scenarios.

    Allow writers to view cached content

    Select to bypass the default behavior of not allowing people with edit rights to cached their pages.

     

    Procedures for Object Cache

    Microsoft Office SharePoint Server 2007 supports caching of certain page items, such as navigation data and data accessed through cross-list queries. Caching page items is fast and eliminates the need to retrieve field data from the database each time a page is rendered. The caching system caches complete field data for a page, excluding data for any Web Part controls on the page.

    Caching for objects in a page can almost always be used. When users have a document checked out, the cache is bypassed.

     

    Configure the object cache
    On the Site Actions menu, point to Site Settings, and then click Modify All Site Settings.

    Under Site Collection Administration, click Site collection object cache.

    In the Object Cache Size section, type a value in the box to specify the amount of memory (in megabytes) that you want the object cache to use.

    In the Cross List Query Cache Changes section, select one of the following options:

    If your content changes frequently and you want to display the most accurate results possible, select Check the server for changes every time a cross list query runs.

    On site collections where the improved performance you get from caching does not compromise the accuracy of the results, select Use the cached result of a cross list query for this many seconds and type the amount of time in seconds to cache the results of the query

    In the Cross List Query Results Multiplier section, type a number from 1 through 10 to use as a results multiplier.

    Type a larger number if your site collection has unique security permissions applied to many lists and sites. Type a smaller number if your site collection does not have unique permissions on each list or site. A smaller multiplier uses less memory per query.

    Click OK.

    Flush the object cache
    On the Site Actions menu, point to Site Settings, and then click Modify All Site Settings.

    Under Site Collection Administration, click Site collection object cache.

    In the Object Cache Reset section, do one or more of the following:

    To force the current server to flush its object cache, select the Object Cache Flush check box.

    Select one or more check boxes. When you click OK, all entries in the object cache are flushed immediately.

    If you do not select one more check boxes, the object cache manages the expiration of items based on when they time-out or are changed in the site.

    Click OK.

     

    Enabling and Modifying Disk-based Caching

    Disk-based caching controls caching for binary large objects (BLOBs) such as image, sound, and video files, as well as code fragments. Disk-based caching is extremely fast and eliminates the need for database round trips. BLOBs are retrieved from the database once and stored on the Web client. Further requests are served from the cache and trimmed based on security.

    Disk-based caching is disabled by default. To enable and customize the disk-based cache, you must modify the following statement in the web.config file for the SharePoint Web application mapped to the Internet Information Services (IIS) Web site:

     Copy Code
    <BlobCache location="C:\blobCache" path="\.(gif|jpg|png|css|js)$" maxSize="10" max-age="86400" enabled="false"/>

    In the preceding example:

    location is the directory where the cached files will be stored

    path specifies in the form of a regular expression which files are cached based on the file extension

    maxSize is the maximum allowable size of the disk-based cache in gigabytes

    max-age specifies the maximum amount of time in seconds that the client browser caches BLOBs downloaded to the client computer. If the downloaded items have not expired since the last download, the same items are not re-requested when the page is requested. The max-age attribute is set by default to 86400 seconds (that is, 24 hours), but it can be set to a time period of 0 or greater.

    enabled is a Boolean that disables or enables the cache

    Flushing the Disk-based Cache
    On the Site Actions menu, point to Site Settings, and then click Modify All Site Settings.

    Under Site Collection Administration, click Site collection object cache.

    In the Disk Based Cache Reset section, do one or more of the following:

    To force the server to reset its disk-based cache, select Force this server to reset its disk based cache.

    To force all servers to reset their disk-based caches, select Force all servers in the farm to reset their disk based cache.

    If you select one or more of the check boxes, all entries in the disk caches are flushed immediately when you click OK. If you do not select any of the check boxes, the disk caches are left unchanged and item expiration is managed, with items being removed when they are changed in the site or when the disk size is exceeded.

    Click OK.

    I thought it would be easier having all the different types of caching for MOSS available in one place. Stick out tongue

  • MOSS build 12.0000.6315.5000 Prime Update will be available publicly in June

    Hey Community,

    Just to make you all aware that the Prime Rollup update is now available on request for Premier customers if required now, taking you to build 12.0000.6315.5000 and publicly available in June 2008. This hotfix come in the standard way of a WSS fix [KB Article Number(s): 942489, 952698] and a MOSS fix [KB Article Number(s): 942489, 952704]. There are a lot of fixes within this prime rollup from a publishing perspective [CMS].

    Issue:

    With regards to applying this build 12.0000.6315.5000 once you have applied the fixes that there is an slight issue starting the "SPAdmin Service". The timeout period for this service is to short and you will get an error in the Event Logs showing an error of  "The service process could not connect to the service controller".

    If you try to manually start this service this is not possible. To successfully start the SPAdmin service you have to modify/add two registry values:


    1. HKLM\SYSTEM\CurrentControlSet\Control     ->         add/modify DWORD value ServicesPipeTimeout to 60000 (60 seconds) [Make sure the base type is decimal]
    2. HKLM\SYSTEM\CurrentControlSet\Control     ->         add/modify STRING value WaitToKillServiceTimeout to 120000 (120 seconds) [Make sure the base type is decimal]
    3. Reboot the server
    4. Manually start the SPAdmin service using: net start spadmin

     

  • Getting the correct MOSS / WSS version for each server in the farm

    I have seen a few blogs recently talking about how to get the correct version of MOSS from your server's in your server farm. Tongue Tied Sound easy enough.

    What I have seen; are articles telling you to go to the web sites properties of your site collection in IIS and then to select the HTTP Headers tab, here you will see a "Custom HTTP headers" text box which displays a version number of MOSS. GREAT!

    or

    Go to "Add/Remove Programs" within control panel select "Microsoft Office SharePoint Server 2007" and click "Click here for support information". On the dialog you will see a version number indicating MOSS version. Suppose to be good! 

    If you think this is correct then read on!

    This method of getting the version number for MOSS is not correct. What you will see in the HTTP header tab in IIS is the build version of MOSS at the time when the Virtual Directory [Web Application] was created, if you patch the server with a Service Pack, Hot Fix or a Roll up Fix, the HTTP header tab is not updated with new build version number on existing sites, which can confuse a lot of people. Tongue Tied If you create a Web Application [Virtual Directory] after you have patched the server you will get the Build Version number of MOSS, at the time the site is created. I bet most SharePoint veterans must have wondered why one HTTP header on there site collections may have been different to another site collection on the same server. It proberbly because you have created both site collections at different times with different patches applied to your farm. I noticed that the "Add/Remove Program" method too did not update.

    The correct way to get this information is to open up "Central Admin", click on "Operations" and then click on "Servers in Farm". in this administration page you will see the Database Schema Version in the top of the screen and a list of servers with the version numbers listed in the relevant column against each server in the farm. You can also see the database schema version in "Site Settings", "Modify All Site Settings" in the Site Information section. The other alternative is to look at the MOSS configuration database [SQL Server] of your site collection and open the Versions table, there will be entires in this table with the versions that have been applied to in your farm and the date when the Service Pack, hot Fix or Rollup was applied. Big Smile

    I have listed below the version numbers for MOSS;

    MOSS 2007 or WSS 3.0 Hotfix (KB953484 - KB953473 - KB953471)   12.0.0.6317.500

    MOSS 2007 or WSS 3.0 Hotfix (KB953138 - KB953137)   12.0.0.6316.500
    MOSS 2007 or WSS 3.0 Hotfix (KB952704)                     12.0.0.6315.500

    MOSS 2007 or WSS 3.0 post-SP1 hotfix (KB952294)       12.0.0.6314.500 [In SSP admin you will get a new Search Administration option, which brings the Search Server features to MOSS.]
    MOSS 2007 or WSS 3.0 post-SP1 hotfix (KB948945)       12.0.0.6303
    MOSS 2007 or WSS 3.0 post-SP1 hotfix (KB941274)       12.0.0.6301
    MOSS 2007 or WSS 3.0 post-SP1 hotfix (KB941422)       12.0.0.6300
    MOSS 2007 or WSS 3.0 SP1                                         12.0.0.6219
    MOSS 2007 or WSS 3.0 October public update                12.0.0.6039
    MOSS 2007 or WSS 3.0 August 24, 2007 hotfix package  12.0.0.6036
    MOSS 2007 or WSS 3.0 RTM                                         12.0.0.4518
    MOSS 2007 or WSS 3.0 Beta 2 TR:                                12.0.0.4407
    MOSS 2007 or WSS 3.0 Beta 2:                                     12.0.0.4017

  • Troubleshooting SPSite/SPWeb leaks in WSS v3 and MOSS 2007

    Just wanted to make the community aware of a new blog just written by Stefan Gobner (EE Engineer at Microsoft and also a colleague of mine). He explain very well the steps that can be taken by SharePoint Administrators to isolate if a site that contains custom code, which does not properly dispose objects correctly and also how you can isolate components that are leaking these objects.

    http://blogs.technet.com/stefan_gossner/archive/2008/05/07/troubleshooting-spsite-spweb-leaks-in-wss-v3-and-moss-2007.aspx 

    Keep up the great work Stefan your a living legend. Wink

  • MOSS AntiVirus Guidelines

    I find that a lot of companies implementing MOSS into their organisations are not really thinking about Antivirus software that is running at the Operating System level. There are a number of products out there talking about MOSS Antivirus plug in etc, but these plug in are checking for documents that are being pushed into MOSS for viruses.

    MS Fore Front Security for SharePoint:

    http://www.microsoft.com/forefront/sharepoint/en/us/product-overview.aspx

    McAfee:

    http://us.trendmicro.com/us/products/enterprise/portalprotect/index.html

    But there seems to be a big area that companies are forgetting about, that can effect the stability of MOSS servers and cause a lot of issues that really confuse IT professionals. The OPERATING SYSTEM ANTIVIRUS. Wink

    To rule out any interference that the operating system antivirus software might bring to SharePoint's stability, the following exclusions from the antivirus real-time scan are recommended:

    Windows 2003 Server

     

    ·    The %systemroot% is normally the C:\WINDOWS or C:\WINNT directory depending on your OS·    %systemroot%\System32\Spool (and all the sub-folders and files)·    %systemroot%\SoftwareDistribution\Datastore·    Any Network Drives that are mapped Refer to the following article for information:

    KB822158 - Virus scanning recommendations for computers that are running Windows
    Server 2003, Windows 2000, or Windows XP http://support.microsoft.com/kb/822158
     

    Internet Information Server

    • The IIS compression directory (default compression directory is %systemroot%\IIS Temporary Compressed Files)
    • %systemroot%\system32\inetsrv folder
    • Files that have the .log extension
    Refer to the following knowledge base articles for reference:
    KB817442 - IIS 6.0: Antivirus Scanning of IIS Compression Directory May Result in 0-Byte File
    http://support.microsoft.com/kb/817442
    KB821749 - Antivirus software may cause IIS to stop unexpectedly http://support.microsoft.com/kb/821749

    SQL Server

    • Exclude .MDF, .LDF, .NDF, .TRN, .BAK and .SLS
    • Exclude sqlmangr.exe and sqlservr.exe
    • SQL folder and databases files (or database file types) from scanning for performance reasons:
    KB309422 - Guidelines for choosing antivirus software to run on the computers that are running SQL Server http://support.microsoft.com/kb/309422

    WSS 3,0 / MOSS 2007 

    • Drive:\Program Files\Microsoft Office Servers\12.0
    • Drive:\Program Files\Common Files\Microsoft Shared\web server extensions\12
    • Drive:\DOCUME~1\ALLUSE~1\APPLICATION DATA\MICROSOFT\FIREWALL CLIENT\*
    • Drive:\WINDOWS\Temp\WebTempDir\*
    • Drive:\DOCUMENTS AND SETTINGS\<SPSServiceAccount>\LOCAL SETTINGS\APPLICATION DATA\*
    • Drive:\Documents and Settings\\<SPSServiceAccount>\Local Settings\Temp\*
    • Drive:\WINDOWS\system32\LogFiles
    • W3wp.exe, cbd.exe, cidaemon.exe, owstimer.exe (WSS)
    (where Drive: is the drive letter where you installed SharePoint Portal Server)

     

    MOM

    ·    Drive:\Documents and Settings\All Users\Application Data\Microsoft\Microsoft Operations Manager

    ·    Drive:\Program Files\Microsoft Operations Manager 2005

     

    If you are using Trend Micro the follow these guide lines:

    • Temp folder:  C:\Program Files\Trend Micro\PortalProtect\temp
    • Quarantine folder, whose default location is:
    Drive:\Program Files\Trend Micro\PortalProtect\Quarantine
    • Backup folder, whose default location is:
    Drive:\Program Files\Trend Micro\PortalProtect\Backup

    The following link will provide you how you can configure MOSS anti-virus, not Operating System Anti-Virus.

    http://technet2.microsoft.com/Office/f/?en-us/library/1289e6e2-03e0-4f10-8921-e516187891c61033.mspx

    One of my recomendation before logging Microsoft PSS calls is to make sure you have these guidelines applied in your environment, this could save a lot of  time & money with regard to support issues. I hope this helps. Stick out tongue

    I thought I would add this to the post; the offical KB article associated to "Folders may have to be excluded from antivirus scanning when you use a file-level antivirus program in Windows SharePoint Services 3.0 or in SharePoint Server 2007": http://support.microsoft.com/kb/952167

  • MOSS - Error : Unable to find an entry point named 'OshFGetSafeHtmLAllocForManaged3' in DLL 'osafehtm.dll'

    This is not a pretty error and can make you run around the house's trying to figure out what the hell is going on. Tongue Tied

    The exception tend to occurs when you try to publish changes on a site page within MOSS.

    You normally see the following error stack:

    “Application error when access /_layouts/AddNavigationLinkDialog.aspx, Error=Unable
    to find an entry point named 'OshFGetSafeHTMLAllocForManaged3' in DLL
    'osafehtm.dll'. at
    Microsoft.SharePoint.Publishing.Fields.SafeHtmlWraSurprisepper.NativeMethods.OshFGetSafeHTML
    AllocForManaged3(Byte[] htmlSourceBytes, Int32 htmlSourceBytesSize, Int32
    htmlSourceCodePage, Byte** htmlReturnedBytes, Int32& htmlReturnedBytesSize, Int32
    convertToDestinationCodePage, Int32 safeHtmlBehaviorFlags, String[] tagsToHandle,
    Int32[] tagHandlingFlags, Int32 tagHandlingCount, Int32& tagHandlingResultFlags,
    EditOrDropUrlsDelegate urlHandlingCallback, Boolean& isSafeHtml) at
    Microsoft.SharePoint.Publishing.Fields.SafeHtmlWrapper.GetSafeHtml(String
    stylecopStringUnsafeHtml, Int32 safeHtmlBehaviorFlags, Hashtable tagsAndFlags...”

    Now I have seen a lot of people using a temporary work around for this which is, to run from a command line "psconfig.exe -cmd secureresources" and then a iisreset.
    Well this is interesting because this seems to cure the issue for about 24 hours and then the issue seems to arise again. Oh my god! The business impact this must be having on some of the companies out there. Surprise Now the secureresources command performs SharePoint Products and Technologies resource security enforcement on the server. For example, security is enforced on files, folders, and registry keys. So why would something like this cure the issue for about 24 hours. I was amazed. Surprise

    So lets look at this in a bit more detail. The stack trace shows an error with OshFGetSafeHTMLAllocForManaged3 which tells us that the dll used here is osafehtm.dll. This dll is a MOSS wrapper assembly used with the HTML controls on site pages and is used widely across the MOSS UI pages.

    The OshFGetSafeHTMLAllocForManaged3 function is used mainly when there are pages that are using image or hyperlink HTML controls on a page. Also to note that the osafehtm.dll resides in the following directory in MOSS C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN\ directory. When I looked closely at the server configuration which the exception occurred I also noticed C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\BIN\ directory. And as soon as I took a peak in this directory I noticed the office 11 version of the osafehtm.dll in this directory. Bingo! Renamed the file to z_osafehtm.dll and ran a iisreset /restart the error never did occur again. Stick out tongue Infact I renamed the 60 directory to z_60.

     So here's the logic:

    1. The error seems to only occur on configurations that have been upgraded from SPS2003 to MOSS.

    2. With the upgrade both the C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN\ and C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\BIN\ are defined paths, which means the incorrect dll can be loaded.

    So why does it work for 24 hours after you run psconfig.exe securedresources and a IISReset:

    I think this is because the secured resources must force 12\bin directory path to be read and loads the correct version of the osafehtm.dll assembly and the IISReset will reset all cached assemblies that are loaded in memory or cached by IIS. Within 24 hours the Application Pool will recycle itself if the default setting for the application pook are configured and at this point there are two different versions of the assembly that now can be loaded because the C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\BIN\ is also a defined path and MOSS then loads the incorrect version of osafehtm.dll.

     

  • Create a Google Map Web Part for Free

    So you are looking at creating a google map web part for your MOSS web site and for FREE and done in minutes.

     

    Well this can be achieved in minutes and you could surprise yourself! There is no special development required to achieve this, just a little bit of HTML, a link out to the web from your MOSS server as the google map api will need to communicate to the google map server and a google API key which you can request from here. The google API key, is a key that will be mailed to you from google, once you have submitted the google api key form, you will need to agree to Google Standard Terms and Conditions and provide the URL of your MOSS site.  

    PreReq

    1. MOSS Server

    2. Goggle API Key

    How Too

    1. Open a Moss site where you would like to place your Goggle Map web part.

    2. Place a Content Editor Web Part in the Page of the site.

    3. Edit the content Editor Web Part and in the proerties of this web part open the source editor. Do not use the Rich Text Editor.

    4. Copy and paste the folloing code in the sorce editor:

    <script src="http://maps.google.com/maps?file=api&v=1&key=ADD_YOUR_GOGGLE_API_KEY_HERE" mce_src="http://maps.google.com/maps?file=api&v=1&key=ADD_YOUR_GOGGLE_API_KEY_HERE" type="text/javascript">

    </script>

    <div id="map" style="width: 400px;height:300px"></div>

    <script type="text/javascript">

    var map = new GMap(document.getElementById("map")); map.centerAndZoom(new GPoint(-0.160265, 51.51443), 3);

    </script>

    5. Apply and OK.

    6. And Voila!

    There is a good site that will get you the latitude and longitude coordinates of your desired location, that will be used when communicating to the google map server:

    http://geo.localsearchmaps.com/?street=45+Oxford+Street&city=London&country=UK

    Notice in the above URL you send the Building Number & the street, city, country and the site will return a text page of the latitude and longitude co-ordinates that you can use, for your desired location.

    If you want to add scaling and repositioning to your web part then add the following into your code, after the var map = ...... Line:

    map.addControl(new GLargeMapControl());

    This web part can be achieved in a matter of a few minutes and can save you some money, I have seen companies charging $400.00 for this. Surprise

    You can also add mapping markers and Location descriptions into your web part very easily. I will write another post showing this. Stick out tongue 

     

     

  • Closing of the SPWeb or SPSite Object within Web Part Development

    I wrote a base class for one of my clients and started to gather some web part information within my base class inheritted from my Web Part. I started to use the base class and it worked well, until I wanted to edit the web part and tried to change some of the properties attached to the web part. As soon as I applied the changes I would get an error of, "The SPWeb object is no longer valid". Looking through my code I realised I was explicitly closing the spweb object in a final statement. Code looked like this;

                           SPWeb oSite = SPControl.GetContextWeb(Context);
                            try
                            {

                                return oSite.ID.ToString();
                            }
                            catch (Exception exm)
                            {
                                throw new Exception(exm.Message);
                            }
                            finally
                            {
                                oSite.Dispose();
                            }

    I removed the oSite.Disposed from my finally section and it all worked. Big Smile

    What I realised was that when you are using the Current Context to create a spweb object, you should not close or dispose of the object, or use it within a using statement, [using statement automatically call's the dispose method at the end of the using section] because other places within your site page will more then likely want to use this object. E.G when you want to change a property of a web part, etc...

    There is a great article on MSDN that provides developers with best practices of disposing sharepoint services object.

  • Broken SharePoint Site Page

    If you ever find that one of your web parts are erroring on a particular site because some custom web part is throwing an exception and stops the site page from loading then one of the first thing you should do is try adding contents=1 to the end of the url for the site you are trying to access.

    http://<SharePoint Server>/Pages/<Site Name>/default.aspx?contents=1

    This will load a web part maintenance page for that site, from here you can remove the erroring web part from the site page.

  • SharePoint End User Training Kit - Available Now - No Cost

    Information Provided by  Microsoft SharePoint Product & Technologies Team:

    The SharePoint End User Training Kit is Microsoft ShairePoint Product & Technologies offering for End User Material and it's available at no cost!

    The initial release of the kit includes training content for SharePoint's collaboration capabilities. To be added over the next couple of months are additional modules covering portals and personalization, enterprise content management, search, business processes, and business intelligence. All of the content will have been written by the Office Online User Assistance team.

    Grab it Here http://www.codeplex.com/slk The kit will be provided with two deployment options. The first, which is available now, is via the SharePoint Learning Kit ("SLK"), which is SCORM 2004 conformant e-learning delivery and tracking application built as a WSS 3.0 solution. With the SLK, IT personnel can control the look and feel of the training kit, matching it to corporate branding standards, and administrators can add or remove content and customize it as necessary. The SLK also provides a reporting function that shows which topics have been completed and by whom.

    The SharePoint End User Training Kit will also have a standalone deployment option, which can be installed on a PC and used by an individual. This version of the kit will be available within the next few weeks.

  • Creating your own custom Base Class with your own MOSS Web Part

    Wink I had a requirement that required me to create a custom base for web parts to provide a common library for web part development within MOSS. I started to research on how this could be done and found very little information that explained the whole process of trying to achieve this and literally any form of reference to this topic in the 3.0 WSS SDK August 2007 did not exist. So I needed to do something to assist the development community.

    So lets cut the chase and start showing you how this is done.

    Firstly we need to create a new class project within Visual Studio and lets call this WebPartBase. In this example we will retrieve the webpart id and title of the webpart and place this in a protected string called WebPartID and WebPartTitle, I have also included some of the site properties into the base class. Our Base class will inherit from the System.Web.UI.WebControls.WebParts.WebPart base class, which is the base class Microsoft provide you to inherit for developing web parts. Our custom web part will inherit our custom base class, which for the purpose of the blog will only be two properties from the webpart and three properties from the Site object and place them into a strings. As soon as we inherit our base class we automatically inherit these strings into our web part. When we put this into perspective, you have the whole .Net framework their available to you as a developer that could be used as a library for comon tasks that you may require for all your web part development. e.g. Application Logging, Standardise on variable name's across your Line of Business applications for all web parts, custom behaviour across the board for all web parts, etc. I think you get the picture. Wink

    Lets Get Started.

    1. Create New Class Project within Visual Studio 2005 and call this WebPartBase.

    Add the following bit of code into your WebPartBase class so it should like something like this.

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Web;


    using Microsoft.SharePoint;
    using Microsoft.SharePoint.WebControls;
    using Microsoft.SharePoint.WebPartPages;


    namespace bobby.habib.base
    {

        public class PortletBase : System.Web.UI.WebControls.WebParts.WebPart
        {
            /// <summary>
            /// Public default constructor.
            /// </summary>
            public PortletBase()
            {

            }

                #region Web Part Settings

                protected string WebPartID
                {
                    get
                    {
                        return base.ID;
                    }
                }

                protected string WebPartTitle
                {
                    get
                    {
                        return base.DisplayTitle;
                    }
                }

                #endregion

                #region Site Settings

                protected string SiteID
                {
                    get
                    {
                        try
                        {
                            SPWeb oSite = SPControl.GetContextWeb(Context);
                            try
                            {

                                return oSite.ID.ToString();
                            }
                            catch (Exception exm)
                            {
                                throw new Exception(exm.Message);
                            }
                            finally
                            {
                                oSite.Dispose();
                            }
                        }
                        catch (Exception ex)
                        {
                            throw new Exception(ex.Message);
                        }
                       
                    }
                }

                protected string SiteTitle
                {
                    get
                    {
                        try
                        {
                            SPWeb oSite = SPControl.GetContextWeb(Context);
                            try
                            {

                                return oSite.Title;
                            }
                            catch (Exception exm)
                            {
                                throw new Exception(exm.Message);