Preupgradecheck errors -Part -2


The following feature(s) are referenced by the content, but they are not installed on the web server

 Name = Unknown, Feature id = GUID, Reference count = 1, Scope = Web, Status = Missing             
 Name = Unknown, Feature id = GUID, Reference count = 2, Scope = Web, Status = Missing             
 Name = Unknown, Feature id = GUID, Reference count = 1, Scope = Web, Status = Missing            

Steps to fix the errors

    1st Method

1. Download Feature Admin tool from http://featureadmin.codeplex.com/
2. Run the exe and click “Find faulty features” in the farm which will detect the faulty features now remove the faulty feature by using “Remove Feature from farm” option.

    2nd method

1.From the PreUpgradeCheck report note the feature GUID
2. Run following query on DBs (Content db and central admin db) to verify that the feature exists on Central Admin DB

SELECT * FROM FEATURES WITH(NOLOCK) WHERE FEATUREID=’GUID’

This query will display WebId , SiteId and other details about the feature.
3. Run

STSADM -o deactivatefeature -id GUID -force            

4. Download the utility WssRemoveFeatureFromSite from http://code.msdn.microsoft.com/WssRemoveFeatureFrom
5. Go to command prompt and point to WSSRemoveFeatureSite directory and type:
WssRemoveFeatureFromSite -scope (site|sitecollection) -url -featureid -force

Advertisements

Preupgradecheck errors -Part -1


Missing server file or server configuration issues.
Web part Errors:
The following web part(s) are referenced by the content, but they are not installed on the web server

•Id = 72818beb-d38f-ce20-ad03-17a569674760, Type = Unknown, Reference = 29, Status = Missing             
•Id = b0361b90-8e73-425f-bcbc-2b2469198a00, Type = Unknown, Reference = 14, Status = Missing             
•Id = 19060b95-1c73-5a5b-875c-2e2c7d7cd355, Type = Unknown, Reference = 4, Status = Missing             

Steps to fix the errors
1.Logon to Database server and Run following SQL query on the content database for the Support site:

SELECT * FROM [WebParts] WITH(NOLOCK)where tp_WebPartTypeId =’ID’             
Example: SELECT * FROM [WebParts] WITH(NOLOCK)where tp_WebPartTypeId ='72818beb-d38f-ce20-ad03-17a569674760'             
            

From the results pane copy the tp_PageUrlID . These are the ids of the urls which has reference to the missing webparts .

2.Now run following query:

SELECT * FROM Alldocs WITH(NOLOCK)where id='80A251DD-1452-4199-A0BA-05120A7286EC'            

(ID is the value of the tp_PageURLID)

You will get DirName and LeafName corresponding to that PageURLID

3.Repeat step-2 for all the PageURL Ids to get complete URLs for a particular webpart ID. Step-1 and Step-2 needs to be performed multiple times to get a list of all the URLs where we need to fix the webpart error.
4.Now go to the URL, example :http://abc.amd.com/test/pages/test.aspx?contents=1
5.Check-out the page , delete the error web part and check-in/publish the page
6.To test if the issue is fixed run the below query again:

SELECT * FROM Alldocs WITH(NOLOCK)where id='80A251DD-1452-4199-A0BA-05120A7286EC'

again.

You should not get any results if all the URLs are fixed.

How to determine which MOSS sites/subsites are not used anymore?


For most of the SharePoint Admins this is a Challenge as analyzing usage logs if you have 1000+sites is almost impossible plus it gives data for only 30 days. What if we need to delete the sites which are not accessed by anyone in last 6 months/1 year?
Site auto deletion feature may not be feasible for everyone.

Below are some methods which can be utilized to solve the purpose

1. 1st Method- MSIT SharePoint Reporting Framework – This tool can be used to check last content modified date and other useful infomation to the site admins . Tool is available at codeplex-http://msitsrf.codeplex.com/ . But this should not be used on production database and the content database should be coiped to test farm if you need to execute the queries.

2. 2nd method- If your requiremnt is to get the last accessed date and you are not bothered if the content is modified recently or not then “Daylastaccessed” column in dbo.Webs is what you are looking for.

Daylastaccessed – column gives value that specifies the last day the site was accessed, which is expressed as the number of days since January 1, 1899 until the last day the site was accessed.
This column is currently used by the usage processing code, but it can also be used in ad-hoc queries to check which sites have been used most recently and which have been used least recently. For example, Select FullUrl,DayLastAccessed From Webs Order By DayLastAccessed.
Sites that have never been used or that have never had their usage data processed for some reason will have this field set to 0.

Use following sql query to extract the information from the content database. This query also converts the smallint type to datetime and gives exactly what you need :

SELECT FullUrl AS ‘Site URL’, TimeCreated, DATEADD(d,DayLastAccessed + 65536,
CONVERT(datetime, ‘1/1/1899’, 101)) AS
lastAccessDate
FROM [DATABSE_NAME].dbo.Webs
WHERE (DayLastAccessed 0)

HTTP Error 500.19 – Internal Server Error after installing Office Web Application


Recently i installed Office Web apps and once i completed the configuration , i noticed that i was getting error on all the site collections on the farm:

It appered that Office web Apps installation messed up the web.config files and problem was resolved by manually removing the following duplicate enteries from the web.config files:

<staticContent>            
      <mimeMap fileExtension=".atomsvc" mimeType="application/atomsvc+xml" />            
      <remove fileExtension=".svg" />            
      <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />            
    </staticContent>            
    <staticContent />            
  </system.webServer>

Powershell Script to enable/disable Blob Caching on SharePoint 2010 Farm


# Enable-SPBlobCache Function            
function Enable-SPBlobCache {             
param(             
                [Parameter(Mandatory=$true, ValueFromPipeline=$true, Position=0)]            
                [Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind]             
                $WebApplication,            
                [Parameter(Mandatory=$false, ValueFromPipeline=$true, Position=1)]            
                $BlobCacheLocation="E:\BlobCache\"            
)             
            
process {             
    $WebApp = $WebApplication.Read()             
    # SPWebConfigModification to enable BlobCache             
    $configMod1 = New-Object Microsoft.SharePoint.Administration.SPWebConfigModification             
    $configMod1.Path = "configuration/SharePoint/BlobCache"             
    $configMod1.Name = "enabled"             
    $configMod1.Sequence = 0             
    $configMod1.Owner = "BlobCacheMod"             
    ## SPWebConfigModificationType.EnsureChildNode -> 0             
    ## SPWebConfigModificationType.EnsureAttribute -> 1             
    ## SPWebConfigModificationType.EnsureSection -> 2             
    $configMod1.Type = 1             
    $configMod1.Value = "true"            
                                            
    ######################################################################            
                            
                # SPWebConfigModification to enable client-side Blob caching (max-age)             
    $configMod2 = New-Object Microsoft.SharePoint.Administration.SPWebConfigModification             
    $configMod2.Path = "configuration/SharePoint/BlobCache"             
    $configMod2.Name = "max-age"             
    $configMod2.Sequence = 0             
    $configMod2.Owner = "BlobCacheMod"             
    ## SPWebConfigModificationType.EnsureChildNode -> 0             
    ## SPWebConfigModificationType.EnsureAttribute -> 1             
    ## SPWebConfigModificationType.EnsureSection -> 2             
    $configMod2.Type = 1             
    $configMod2.Value = "86400"             
                            
                ######################################################################            
                            
                # SPWebConfigModification to change the default location for the Blob Cache files            
                $configMod3 = New-Object Microsoft.SharePoint.Administration.SPWebConfigModification            
                $configMod3.Path = "configuration/SharePoint/BlobCache"            
                $configMod3.Name = "location"            
                $configMod3.Sequence = "0"            
                $configMod3.Owner = "BlobCacheMod"            
                ## SPWebConfigModificationType.EnsureChildNode -> 0             
    ## SPWebConfigModificationType.EnsureAttribute -> 1             
    ## SPWebConfigModificationType.EnsureSection -> 2             
                $configMod3.Type = 1            
                $configMod3.Value = $BlobCacheLocation            
    # Add mods, update, and apply             
    $WebApp.WebConfigModifications.Add( $configMod1 )             
    $WebApp.WebConfigModifications.Add( $configMod2 )            
                $WebApp.WebConfigModifications.Add( $configMod3 )            
    $WebApp.Update()             
    $WebApp.Parent.ApplyWebConfigModifications()             
}             
}            
            
            
            
# Disable-SPBlobCache Function            
function Disable-SPBlobCache {             
param(             
    [Parameter(Mandatory=$true, ValueFromPipeline=$true, Position=0)]             
    [Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind]             
    $WebApplication             
)             
            
process {             
    $WebApp = $WebApplication.Read()             
    $mods = @()             
    foreach ( $mod in $WebApp.WebConfigModifications ) {             
        if ( $mod.Owner -eq "BlobCacheMod" ) {             
            $mods += $mod             
        }             
}             
    foreach ( $mod in $mods ) {             
        [void] $WebApp.WebConfigModifications.Remove( $mod )             
    }             
    $WebApp.Update()             
    $WebApp.Parent.ApplyWebConfigModifications()             
}             
}            

Working of the Script:

  1. Copy Blobcache.ps1 to local drive on Sharepoint server or on a file share
  2. This script is using Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind  class of Microsoft.SharePoint.PowerShell assembly so we need to make sure we add the reference in PS by running command

Add-PSSnapin Microsoft.SharePoint.PowerShell

  1. Set the executionpolicy to unrestricted
  2. Run the script (Dot source it) – type a period and a blank space and then type the path to the script file (see the screenshot)
  3. Execute Enable-SPblobcache function to enable blobcaching, supply the webapplication name on the prompt
  4. To disable execute Disable-SPblobcache

**Location of Blobcache folder, max age etc can be changed from the script itself.

** If you enable blob caching using Enable-SPblobcache function then be sure to disable it using Disable-SPblobcache function (dont do it manually).