Friday, May 24, 2013

People Picker Control - SharePoint 2010 ( Customizing Search Results)

For customizing search results in people picker configured for Windows Authentication in Classic Mode or claims mode check below link
http://technet.microsoft.com/en-us/library/gg602075(v=office.14).aspx


To customize search results in people picker configured in different authentication mode, you need to define custom claims provider:
http://technet.microsoft.com/en-us/library/gg602068(v=office.14).aspx#about








Thursday, May 23, 2013

WSS_Logging DB SharePoint 2010 ( Usage Reporting)

SharePoint 2013 is out  but i still get the queries regarding the usage reporting capability of SP 2010.

Some pointers below.

  • The data displayed by SharePoint Web Analytics is pulled from "WSS_Logging" database. It aggregates all of the raw logging data accumulated in the text files under the 14 hive and imports it into logging database. 

  • Web Analytics Service Retention Policy 


          To persist the usage data in WSS_Logging for longer time you can change the retention policy
           by  changing the settings in central administration

          Central Administration - > Application Management - > Manage Servcie Application
          - >Select Web Analytics Service ->Click "Properties" in ribbon ->Change Data Retention
          Period up  to 25 months.


  • The data import from Logs files to Database is performed by Timer Job " Microsoft SharePoint Foundation Usage Data Import"
         You can set the frequency of timer job depending on load on your server.



  • More Information on Logging DB can be found at : 

          http://technet.microsoft.com/en-us/library/hh769360(v=office.14)

Wednesday, May 01, 2013

Implementing SharePoint DR (SQL Server Log Shipping Method)

Great article on SharePoint DR implementation using SQL Server Log Shipping.

http://technet.microsoft.com/en-us/library/dd890507(office.12).aspx



Thursday, April 18, 2013

TagCloud Webpart not available SharePoint 2010

Do you feel like breaking your head is less painful than looking for Tagcloud webpart ?.

Well than don't worry your head is probably safe is you haven't yet given  up searching :-)


Just Activate the PortalLayouts feature

stsadm -o activateFeature -name "PortalLayouts" -url "http:///sites/" -force

Wednesday, April 17, 2013

Usage Data Retention in SharePoint Database - SharePoint 2013

Check the current retention policy using :
Get-SPUsageDefinition

By default it's 14 days.

To change the retention use the following script:

Set-SPUsageDefinition -Identity "Page Requests" -DaysRetained 31


Complete definition of this command can be found at :
http://technet.microsoft.com/en-us/library/ff607542.aspx


Wednesday, March 27, 2013

SharePoint 2010 WSP BackUp

Simple script but very helpful considering the fact that it's easy to mess up and than end up trying to find  old WSP in your source control tool. (If your team has been updating the source control :-)).


Always take WSP backup from SharePoint Farm before you deploy revised one.


$farm = Get-SPFarm
$file = $farm.Solutions.Item("{WSPNAME}.wsp").SolutionFile
$file.SaveAs("C:\Backup\{WSPNAME}.wsp")



-Rags

Friday, February 15, 2013

Claim Based Security explained in real simple way

Check this article if you are trying to understand claims based security
http://msdn.microsoft.com/en-us/library/ff359108.aspx


Sunday, February 10, 2013

Office Web Apps and SharePoint Services(Excel, Word, Powerpoint Services)

I always get queries from peers and clients on difference between SharePoint 2010 and Office Web Apps. They are completely different component. Office Products have tight integration with SharePoint using the Office Web Apps feature installed in SharePoint.

Note : You can run Office Webs Apps using Office Web Apps server even if you do not have SharePoint in your organization.

Useful Links:

Office Web Apps:
http://technet.microsoft.com/en-us/library/jj219456.aspx


Office Web App Server Planning:
http://technet.microsoft.com/en-us/library/jj219435.aspx

Office Web Apps Deployment :
http://technet.microsoft.com/en-us/office/ee815687.aspx

Office Web Apps platform comparison
http://technet.microsoft.com/library/ff925944(office.14).aspx

Excel Services vs Excel Web App
http://blogs.technet.com/b/tothesharepoint/archive/2010/07/21/excel-services-and-excel-web-apps-common-different-features.aspx

Licensing
http://office.microsoft.com/en-us/buy/microsoft-office-volume-licensing-suites-comparison-office-FX101825637.aspx




Tuesday, January 15, 2013

Detect Content DB orphans and delete in a SharePoint 2010 Farm thru Windows PowerShell


Detect orphans in Content DB:

SCRIPT
----------------------------------------------------------------------------------------------------------------------------------
if ( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null ) 
     {Add-PSSnapin Microsoft.SharePoint.Powershell}
       set-location "C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN"
         $SPFarm = Get-SPFarm
           $contentWebAppServices = (Get-SPFarm).services | ? {$_.typename -eq "Microsoft SharePoint Foundation Web Application"} 

               foreach ($SPWebApp in $contentWebAppServices.WebApplications)
                 {
                   foreach ($SPSite in $SPWebApp.Sites)
                     {
                       Write-Host "Going thru Site Collection" $SPSite.Url
                         $SPSite.Url >> C:\SPSiteOrphanObject.txt
                           stsadm.exe -o databaserepair -url $SPSite.Url -databasename $SPSite.ContentDatabase.Name >> C:\SPSiteOrphanObject.txt
                             $SPSite.Dispose()
                               }}
                              ----------------------------------------------------------------------------------------------------------------------------------
                              • To delete orphan objects from a particular site use following script 
                              if ( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null ) 
                               {Add-PSSnapin Microsoft.SharePoint.Powershell}
                               set-location "C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN"
                              stsadm.exe -o databaserepair -url -databasename  >> C:\SPSiteOrphansDelete.txt

                              Note
                              • You can get the Content DB of a particular site collection using below script
                              $site=Get-SPSite
                              write-host $site.ContentDatabase.Name
                              
                              
                              
                              
                              
                              

                              Monday, September 17, 2012

                              Service Unavailable – HTTP Error 503. (SharePoint 2010)

                              When you try to load the page you probably might end up with following error:
                              Service Unavailable – HTTP Error 503

                              First Shot

                              Check Application Pool, most probably it will be turned off. Turn it on and test the portal.


                              If App Pool shuts down once more than

                              Second Shot 


                              Check the eventvwr
                              I had following error message:(not pasting the whole message but the important pointer)

                              The exception message is: Exception has been thrown by the target of an invocation.. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: The farm is unavailable. at Microsoft.SharePoint.Administration.Claims.SPSecurityTokenServiceManager.


                              If your error message is same as mine then try this resolution:

                              Open Application Pool - > Advanced Settings - > Enable 32 Bit Application and Set to FALSE


                              Hope that fixes your error.

                              Have Fun!!!




                              Tuesday, September 11, 2012

                              Admin SVC must be running in order to create deployment timer job

                              Error

                              This error message pops up when solution is installed using powershell command

                              Install-SPSolution -identity test.wsp -webapplication http://test/

                              Resolution

                              Method 1:
                              Go to Administrative Tools > Services and browse to find “Sharepoint 2010 Administration”.
                              Start  Service

                              Method 2:
                              Start-Service SPAdminV4





                              Error Deploying WSP using Visual Studio 2010

                              Issue:

                              Error occurred in deployment step 'Activate Features': Feature with Id  is not installed in this farm, and cannot be added to this scope.


                              Resolution:
                              This is mainly due to inability of Visual Studio 2010 to deploy solution in farm.try deploying the WSP using powershell command in each web front end SharePoint server in farm.

                              Check this article:
                              http://blogs.msdn.com/b/calvarro/archive/2011/11/06/sharepoint-2010-amp-visual-studio-2010-error-ocurred-activate-features-feature-with-id-installed-in-this-farm-cannot-be-added-to-this-scope.aspx

                              Wednesday, July 11, 2012

                              Storing values in SharePoint 2010 Property Bag

                              Property bags?
                              Property bags are place to store metadata or properties.The property bags are implemented as hash table consisting of property names and values.

                              Property bags can be defined at following levels:


                              • Farm (SPFarm class) 
                              • Web application (SPWebApplication class) 
                              • Site collection (SPSite class) 
                              • Site (SPWeb class) 
                              • List (SPList class)


                              Property bags can be set using SharePoint designer and programmatically.

                              Using SharePoint Designer 2010:

                              • Open Site in SharePoint Designer 2010
                              • Go to Site->Site Options
                              • Click on Parameters tab where you can see the list of existing properties, from the same place you can even perform add/modify/remove actions.


                              Programmatically

                              To Read the Set Key:


                              SPSite siteCollection = new SPSite("");
                              SPWeb website = mySite.RootWeb;
                              string MyValue = website.AllProperties["KeyName"]);

                              To Set the Value
                              SPSite siteCollection = new SPSite("  ");
                              SPWeb website = mySite.RootWeb;
                              website.Properties.Add(" KeyName ", "KeyValue");
                              website.Properties.Update






                              Monday, June 25, 2012

                              Adding DLL to WSP SharePoint 2010

                              In order to add custom dll to WSP Package , follow these steps:

                              • Create new Empty SharePoint Project 
                                • File->New->Project->SharePoint(2010)->Empty SharePoint Project 
                                • In second screen provide test site URL
                                • Select "Deploy as Farm Solution"

                              • Expand package node and double click on Package.package file 




                              • Click on "Advanced" Tab



                              • Add the Custom dll's using the "Add" button



                              • Save the project, compile and deploy. Custom dll will be part of WSP.

                              Enjoy!!!!

                              Rags

                              Wednesday, June 13, 2012

                              SharePoint Foundation 2010 Best Practice

                              Sandbox Solution Capabilities

                              Complete Article :http://msdn.microsoft.com/en-us/library/ee231562.aspx

                              In Nutshell


                              Sandboxed solutions support the following capabilities and elements:

                              Content Types/Fields

                              Custom actions

                              Declarative workflows

                              Event receivers

                              Feature callouts

                              List Definitions

                              List Instances

                              Module/files

                              Navigation

                              Onet.xml

                              SPItemEventReceiver

                              SPListEventReceiver

                              SPWebEventReceiver

                              Support for all Web Parts that derive from System.Web.UI.WebControls.WebParts.WebPart

                              Web Parts

                              WebTemplate feature elements (instead of Webtemp.xml)

                              Visual Web Parts

                              Sandboxed solutions do not support the following capabilities and elements:

                              Application Pages

                              Custom Action Group

                              Farm-scoped features

                              HideCustomAction element

                              Web Application-scoped features

                              Workflows with code



                              Monday, June 11, 2012

                              Get Machine Name and IP ASP.NET

                              My previous post has an function which is now deprecated.
                              http://metahat.blogspot.com/2009/09/get-client-machine-name-aspnet.html
                              System.Net.Dns.GetHostByAddress(Request.UserHostAddress).HostName


                              Following are the new function to get client machine name and IP address:

                              string[] computer_name = System.Net.Dns.GetHostEntry(Request.ServerVariables["remote_addr"]).HostName.Split(new Char[] { '.' });
                                                      
                              string machineName=computer_name[0].ToString();
                              string ipAddress  =Request.ServerVariables["REMOTE_ADDR"].ToString();

                              Wednesday, June 06, 2012

                              Powershell Commands (Mostly Used)

                              Here is collection of commonly used powershell cmdlets.
                              More details :
                              http://technet.microsoft.com/en-us/library/ee906565.aspx

                              Add-SPSolution(Uploads a SharePoint solution package to the farm.)
                              Add-SPSolution -LiteralPath c:\contoso_solution.wsp

                              Remove-SPSolution(Removes a SharePoint solution from a farm.)
                              Remove-SPSolution -Identity contoso_solution.wsp

                              Install-SPSolution(Deploys an installed SharePoint solution in the farm.)
                              Install-SPSolution -Identity contoso_solution.wsp -GACDeployment

                              Uninstall-SPFeature(Uninstalls an installed feature definition.)
                              Uninstall-SPFeature -path "MyCustomFeature"

                              Add-SPUserSolution(Uploads a new sandboxed solution to the solution gallery.)
                              Add-SPUserSolution -LiteralPath c:\contoso_solution.wsp -Site http://sitename

                              Disable-SPFeature(Disables an installed SharePoint Feature at a given scope.)
                              Disable-SPFeature –identity "MyCustom" -URL http://somesite

                              Enable-SPFeature(Enables an installed SharePoint Feature at the given scope.)
                              Enable-SPFeature –identity "MyCustom" -URL http://somesite

                              Get-SPFeature(Returns the SharePoint Features based on a given scope)
                              Get-SPSite http://somesite | Get-SPWeb –Limit ALL |%{ Get-SPFeature –Web $_ } | Select DisplayName,ID -Unique

                              Install-SPFeature(Installs a SharePoint Feature by using the Feature.xml file.)
                              Install-SPFeature -path "MyCustomFeature"

                              Uninstall-SPFeature(Uninstalls an installed feature definition)
                              Uninstall-SPFeature -path "MyCustomFeature"


                               

                              SharePoint 2010 101 Code Samples

                              Reference Architecture for AI-integrated Genomic Analytics on Oracle Cloud Infrastructure ( Published in Oracle Blog)

                               I have been thinking about writing this blog for some time. Genomics is a fascinating field and has potential to unlock so many hidden scie...