tag:blogger.com,1999:blog-72119899022210618422024-03-04T23:24:23.582-08:00SharePointVishal Rampurehttp://www.blogger.com/profile/05485139798262138836noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-7211989902221061842.post-18572541866122957392012-08-27T17:51:00.000-07:002012-08-27T17:51:46.513-07:00SharePoint 2010 Patching Issues<h5>
</h5>
<h2>
<span style="font-size: large;">Introduction</span></h2>
<div style="text-align: justify;">
I was recently installing SharePoint 2010 SP1, June 2011 Cumulative update and April 2012 Cumulative update. While going through the patching, I encountered couple of unusual errors. Both the issues were encountered while running the PSConfig command post the patch installation. One of the issues was related to an orphan database entry for webapplication in the SharePoint config database when running the PSConfig command after installing SP1 while, the other issue was the PSConfig command kept failing with the error that June 2011 Cumulative update SharePoint server patch (not the SharePoint foundation patch) was not installed on the servers but, was in fact installed on all the servers. </div>
<h2 style="text-align: justify;">
<br /></h2>
<h2>
<span style="font-size: large;">Issue 1 </span></h2>
<h3>
Description</h3>
<div>
<br /></div>
<div style="text-align: justify;">
The first issue I faced as mentioned above was after installing the SP1 patch and trying to run PSConfig command. I have done a fair bit of patching but never encountered this issue. The PSConfig failed and referred to the upgrade logs as usual to find the error. The upgrade log error listed below was cryptic and did not provide any direct information on what was causing it. </div>
<div style="text-align: justify;">
<b><br /></b></div>
<b>“<i>Attempt to register null pointer at: at Microsoft.SharePoint.Upgrade.SPHierarchyManager.AddNextLevelObjects(Object current, IEnumerable nextObjects)</i>”</b> <br />
<h3>
<br /></h3>
<h3>
Resolution</h3>
<br />
<div style="text-align: justify;">
After breaking my head and stuck at this point I ran a script that we used to list all the databases attached to all the webapplications in the environment. When I checked the file with the output, I found that there was one line with nothing listed there except quotes. This indicated that there was some orphan database entry for a webapplication but was not sure which one. Following are the steps taken to find the webapplication and orphan database entry. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Run the following commands for all the webapplications in the farm </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Note – This is easy to figure if you are using dismount and mount method for patching and upgrading the schema. When all the databases are dismounted and you run this command, the count for databases should be “0” </div>
<b><i><br /></i></b>
<b><i>$db = get-spwebapplication –identity “url of the webapplication”</i></b> <br />
<br />
To get the count of databases attached to the webapplication type the following and hit enter <br />
<b><i><br /></i></b>
<b><i>$db.contentdatabses.count</i></b> <br />
<br />
<div style="text-align: justify;">
This outputs the number of content databases attached to webapplication on the screen, which in our case should be “0” because we have dismounted all the databases for upgrade. Finally one of the webapplications showed the count as “1” which meant that we had got our culprit webapplication. Next step was to delete the orphan entry to do which we needed the guid of the database. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
To get the guid we ran the following sql query on the config database (objects table). </div>
<b><i><br /></i></b>
<b><i>select name, CAST(properties as XML) from objects where Properties like '%SPIisSettings%'</i></b> <br />
<br />
<div style="text-align: justify;">
This provided as on output as shown in the screenshot below. The left column contained the name of the webapplication and right column contains a link to an xml file that lists all the properties of the objects table. </div>
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihgCPbxMmZyxQ61EAsq5QbV6tXUl2CeOu_aEHeXhMTnVmWmo_le9UAP0zfDlqdvHdmNGhq_TPr5euc3RGON259QxRbv2q4Lp98WCmfW5cavAe6hbodcxayFhVoYdkYLUhdlJ3glFshAw/s1600-h/clip_image001%25255B6%25255D.png"><img alt="clip_image001" border="0" height="183" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjh_lTZbVLo72UNPhWTBixCCDVpgLPhYZf1Mb5ebNSV3r5xXK19Vn3yxXoG-XNE-n9yHKPHE4AxLHIhM_x_f1g5hKO8HY1LhOxQO8uMtpnPLlt2W_ooXNkJjOyUBTAroTxMMqaFKtBOyg/?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image001" width="533" /></a> <br />
<br />
<div style="text-align: justify;">
We went through the xml file associated with the webapplication that listed the database count as “1” and searched for the following pattern. </div>
<b><i><br /></i></b>
<b><i><sFld type="Guid">74b52848-f29e-48bb-ab01-5e7aed5d3743</sFld></i></b> <br />
<b><i><fld type="null"/></i></b> <br />
<br />
<div style="text-align: justify;">
Where the “null” in the “fld type” tag denoted an orphan object. We noted down the guid. The next step was to delete the entry. We ran the following commands to do that </div>
<b><i><br /></i></b>
<b><i>$db = get-spwebapplication –identity “url of the webapplication that had the null entry”</i></b> <br />
<br />
<div style="text-align: justify;">
Next run the following command to delete the orphan entry </div>
<div style="text-align: justify;">
<b><i><br /></i></b></div>
<b><i>$db.contentdatabses.delete(“guid”)</i></b> <br />
<br />
<div style="text-align: justify;">
Use the guid we noted down in the earlier step when we ran the sql query. Once the command has run successfully, please verify that the databases count is “0” by the running the following command </div>
<b><i><br /></i></b>
<b><i>$db.contentdatabses.count</i></b> <br />
<br />
<div style="text-align: justify;">
Now you can rerun the PSConfig command and it should complete successfully. </div>
<h2>
<br /></h2>
<h2>
<span style="font-size: large;">Issue 2</span></h2>
<h3>
Description</h3>
<br />
<div style="text-align: justify;">
This issue cropped up when we ran the PSConfig after installing the June 2011 Cumulative Update. The PSConfig would fail with the error that the June 2011 Cumulative Update patch was not installed on all the servers in the farm. We verified that the patch was installed on all the servers by checking the installed updates through control panel > programs. </div>
<h3>
<br /></h3>
<h3>
Resolution</h3>
<br />
We ran the following version of the PSConfig to resolve the issue. This way of running the PSConfig skips the install check part on the farm. <br />
<b><i><br /></i></b>
<b><i>psconfig.exe -cmd upgrade -inplace b2b -force -wait -cmd installcheck –noinstallcheck</i></b> <br />
<br />
The PSConfig should run without checking the patches installed but once the command is completed successfully, please go to central administrator> upgrades and migration> Check product and patch installation status and make sure that none of the patches are listed as missing and the patch for which the PSConfig was failing is listed as installed. <br />
<br />
For issue 1, the following thread helped me <br />
<br />
<a href="http://sharepoint.stackexchange.com/questions/31964/sharepoint-server-2010-update-and-psconfig-issue"><span style="color: blue;">http://sharepoint.stackexchange.com/questions/31964/sharepoint-server-2010-update-and-psconfig-issue</span></a> <br />
<br />
Special thanks to my dear friend and colleague <b><i>Colin White</i></b> who provided me with his expertise in resolving the above issues <br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Vishal Rampurehttp://www.blogger.com/profile/05485139798262138836noreply@blogger.com0tag:blogger.com,1999:blog-7211989902221061842.post-41681452057249405882012-08-19T16:59:00.000-07:002012-08-19T16:59:04.650-07:00Anonymous Access – Disable access to forms under lists and libraries in SharePoint 2010<h3 style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;">Introduction</span></h3>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;">While doing some research on how to disable access to the application and from pages for anonymous users in SharePoint 2010, I came across an interesting feature, the “ViewFormPagesLockdown” feature. This feature when enabled will disallow anonymous users access to application and form pages (allitems.aspx, newforms.aspx etc.) while allowing access to read and download the content from the list and document libraries.</span></div>
<h3 style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></h3>
<h3 style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;">Feature availability</span></h3>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;">The feature is available in SharePoint 2007, SharePoint Foundation 2010 and SharePoint Server 2010 and not available in WSS. This feature is available on only those sites that have been created using the Publishing Portal template. </span></div>
<h3 style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></h3>
<h3 style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;">Usage</span></h3>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;">The feature is enabled by default on a site created using Publishing Portal template. This is a hidden feature and can only be enabled or disabled using STSADM tool in SharePoint 2007 and PowerShell in SharePoint 2010. </span></div>
<h3 style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></h3>
<h3 style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;">SharePoint 2010</span></h3>
<h3>
</h3>
<h3 style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif; font-size: small;"><br /></span></h3>
<h3 style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif; font-size: small;">To enable the feature run the following command</span></h3>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;"><i><br /></i></span></div>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;"><i>Enable-SPFeature –identity "feature name" -URL http://site</i> </span></div>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;">Note – You can use the GUID instead of feature name as well. </span></div>
<h3 style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif; font-size: small;"><br /></span></h3>
<h3 style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif; font-size: small;">To disable the feature</span></h3>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;">It’s a 2 step process to disable the feature </span></div>
<ol>
<li style="text-align: justify;"><span style="font-family: Trebuchet MS, sans-serif;">Get the feature object in a variable using the following command</span></li>
</ol>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;"><i>$feature = get-spfeature viewformpageslockdown</i> </span></div>
<ol start="2">
<li style="text-align: justify;"><span style="font-family: Trebuchet MS, sans-serif;">Run the disable feature command</span></li>
</ol>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;"><i>disable-spfeature $feature -url http://site</i> </span></div>
<h3 style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></h3>
<h3 style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;">SharePoint 2007</span></h3>
<h3>
</h3>
<h3 style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif; font-size: small;"><br /></span></h3>
<h3 style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif; font-size: small;">To enable the feature run the following stsadm command</span></h3>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;">stsadm -o activatefeature -url "site url" -filename ViewFormPagesLockDown\feature.xml</span></div>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<h3 style="text-align: justify;">
<span style="font-family: 'Trebuchet MS', sans-serif; font-size: small;">To disable the feature run the following stsadm command</span></h3>
<div>
<span style="font-family: 'Trebuchet MS', sans-serif; font-size: small;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;">stsadm -o deactivatefeature -url "site url" -filename ViewFormPagesLockDown\feature.xml </span></div>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;">For more information please refer to the following links </span></div>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;">SharePoint 2010</span></div>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;"><a href="http://blogs.msdn.com/b/russmax/archive/2010/01/22/lockdown-mode-in-sharepoint-2010.aspx">http://blogs.msdn.com/b/russmax/archive/2010/01/22/lockdown-mode-in-sharepoint-2010.aspx</a> </span></div>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;">SharePoint 2007</span></div>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;"><a href="http://blogs.msdn.com/b/ecm/archive/2007/05/12/anonymous-users-forms-pages-and-the-lockdown-feature.aspx">http://blogs.msdn.com/b/ecm/archive/2007/05/12/anonymous-users-forms-pages-and-the-lockdown-feature.aspx</a></span> </div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Vishal Rampurehttp://www.blogger.com/profile/05485139798262138836noreply@blogger.com2