Tuesday, February 21, 2012

SharePoint 2010 User profile service


I was asked multiple times to help locate "User Profile Repository" for SharePoint 2010.

You can follow the steps below to access it. You need access SharePoint 2010 "Central admin site" for this purpose.

Select “SharePoint 2010 Central Administration” from start menu
Select “Application Management“
Select “Manage service applications“
Select “User Profile Service Application”
Select “Manage User Profiles”


Thursday, February 16, 2012

How do you “Divide Share Equally” among a number of people?


Easy isn't it.. 100% / number of people   100/2 = 50%

Now 100/3….=  33.33333333333333…….
One compromised solution is 33.33, 33.33 and 33.34.  so one of them will get a 0.01 percent more, if that is not a big deal.

I ended up writing some code for this and I hope it will be useful for you.

See C# sample code below

        private List<double> GetPercentages(double numberOfItems)
        {
            List<double> percentages = new List<double>(); 
            double totalPercentage = 100.00;
            double averagePercentage = Math.Round(totalPercentage / numberOfItems, 2);
            double reminder = Math.Round(100 - (averagePercentage * numberOfItems),2);

            for (int i = 0; i < numberOfItems; i++)
            {
                double percentageValue = averagePercentage;
                if (reminder != 0)
                {
                    if (reminder > 0)
                    {
                        reminder = Math.Round(reminder - 0.01,2);
                        percentageValue += 0.01;
                    }
                    else
                    {
                        reminder = Math.Round(reminder + 0.01,2);
                        percentageValue -= 0.01;
                    }
                }

                percentages.Add(Math.Round(percentageValue,2));
                percentages.Sort();
            }
            return percentages;
        }

Please add a comment if this is useful.

Monday, January 9, 2012

SharePoint : Broken PDF file icon, Search not indexing pdf documents

Issue 1 : PDF file icon is missing in SharePoint server. SharePoint UI shown broken image URL.
Issue 2: SharePoint Search is not indexing PDF document.


Solution :
                Install PDF  iFilter  from 


Please see the original article  from MSDN http://support.microsoft.com/kb/2293357


Configure Adobe iFilter based on steps mentioned below: http://www.adobe.com/support/downloads/detail.jsp?ftpID=4025


  • Install PDF iFilter 9.0 (64 bit) from  http://www.adobe.com/support/downloads/detail.jsp?ftpID=4025
  • Download PDF icon picture from Adobe web site http://www.adobe.com/misc/linking.html  and copy to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES\ 
  • Add the following entry in docIcon.xml file, which can be found at: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML
  • Add pdf file type on the File Type page under Search Service Application
  • Open regedit
  • Navigate to the following location:
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\ContentIndexCommon\Filters\Extension
  • Right-click > Click New > Key to create a new key for .pdf
  • Add the following GUID in the default value {E8978DA6-047F-4E3D-9C78-CDBE46041603}
  • Restart the SharePoint Server Search 14
    • net stop osearch14
    • net start osearch14
  • Reboot the SharePoint servers in Farm
  • Perform FULL Crawl to get search result.
Once the crawl is completed we will get search results and pdf icon


Wednesday, December 28, 2011

SharePoint 2010 : “The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again”



When you try to update or delete an List/Documentlibrary item you may get the following error

“The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again”

This one was driving me nuts for a while as the error description is not very helpful (as usual). 
This is because the "user" doesn't have enough permissions.

One way to handle this is to temporarily allow unsafe update on the web before updating/deleting the List/Documentlibrary item (if you can't grant additional permissions to the "user")

See code below

web.AllowUnsafeUpdates = true;

item.Delete();

web.AllowUnsafeUpdates = false;


Note : If this helped you, please add a comment and share the link as it will motivate me to post more solutions like this.

Telerik Rad Upload Control : File Name issue with certain browsers


File Name issue with certain browsers.

Some browser instances wont work well with the property  "FileName" use "GetName()" method instead

<telerik:radupload>

Hope this save you some time to resolve a hard to reproduce bug with Telerik

See documentation

http://www.telerik.com/help/aspnet-ajax/upload-manipulating-files.html

Monday, December 26, 2011

Thursday, December 22, 2011

Windows 8 Development - Download

http://msdn.microsoft.com/en-us/windows/apps/br229516/