Tuesday, December 28, 2010

SharePoint SSP: Error "The Search....."

When you see a following error when you are working on Search Settings (adding rules etc...),

"The search service is currently offline. Visit the Services on Server page in SharePoint Central Administration to verify whether the service is enabled. This might also be because an indexer move is in progress."

Most of the times, your search service is online unlike what exception states. But if you run the following command, the magic happens and you no longer see the above error.

psconfig -cmd upgrade -inplace b2b -wait

The output looks like this (You will have no idea what was fixed under the hood :)):

Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.

C:\Documents and Settings\kthota>psconfig -cmd upgrade -inplace b2b -wait
SharePoint Products and Technologies Configuration Wizard version 12.0.6413.1000
Copyright (C) Microsoft Corporation 2005. All rights reserved.

Performing configuration task 1 of 4
Initializing SharePoint Products and Technologies upgrade...

Successfully initialized SharePoint Products and Technologies upgrade.
Performing configuration task 2 of 4
Initiating the upgrade sequence...

Successfully initiated the upgrade sequence.
Performing configuration task 3 of 4
Upgrading SharePoint Products and Technologies...

Successfully upgraded SharePoint Products and Technologies.
Performing configuration task 4 of 4
Finalizing the SharePoint Products and Technologies configuration...

Successfully completed the SharePoint Products and Technologies configuration.
Total number of configuration settings run: 4
Total number of successful configuration settings: 4
Total number of unsuccessful configuration settings: 0
Successfully stopped the configuration of SharePoint Products and Technologies.
Configuration of the SharePoint Products and Technologies has succeeded.

C:\Documents and Settings\kthota>

Thursday, October 28, 2010

Singleton Pattern Implementation Template

The following is a Java Template to implement the Singleton pattern. 
 
public class SingletonObject
{
  private SingletonObject()
  {
    // no code req'd
  }

  public static SingletonObject getSingletonObject()
  {
    if (ref == null)
        // it's ok, we can call this constructor
        ref = new SingletonObject();  
    return ref;
  }

  public Object clone()
 throws CloneNotSupportedException
  {
    throw new CloneNotSupportedException(); 
    // that'll teach 'em
  }

  private static SingletonObject ref;
}
 
For more explanation visit: http://www.javacoffeebreak.com/articles/designpatterns/index.html 

Thursday, October 7, 2010

How to evaluate/purchase tools, systems, and products? - Need for process

We all know in the Information Systems industry, there are too many commercial and open source vendors that serve your business needs. Say for ex: you want a portal in your enterprise then you have Liferay, JBoss portal, Oracle weblogic, IBM, Vignette portal, Microsoft SharePoint etc... to name a few. Same applies if you want to purchase a enterprise bus (Oracle, Sun, IBM, WSo2, etc..), cloud service providers (Amazon, Google, Salesforce, Microsoft, Rackspace, etc..), and many other software and hardware systems. If you have delegated to lead a software or hardware system purchase, how do you go about it? what do you consider?

I have been involved directly and indirectly at the companies i have worked and working in purchasing and evaluating some systems. I have seen the leaders taking a formal and informal approaches. I observed that the teams have missed considering some medium and low priority requirements and elements by taking informal/semi-formal approach over formal approach. With the over all experience I gained through my learning from some good leaders, I feel that it is essential to follow a pattern/template/principles to accomplish the better results in a consistent manner. A evaluation/purchase life cycle involves the following steps:

1. Understand: understand the business vision and goals, high level requirements, cost, time lines, and expectations.

2. Planning and Analysis: Form a small to medium sized team of resources if necessary. Analyze the strengths and weakness of legacy systems, existing systems/products, and technical infrastructure if it is a requirement to integrate with the new system. Document the functional requirements and the technical limitations or features.

3. Research and Analysis: Do market research with respect to the systems and products that are available in the market. Share the analysis work across resources. After your analysis, shortlist the potential vendors and get RFP (Request for Proposal) if necessary.

4. Develop a score sheet or score card: After understanding the requirements,  analyzing your current infrastructure and its limitations, and shortlisting the vendors,  prepare a score sheet. A score sheet contains a the key sections (functionality, total cost,  service support, technical solution and architecture, execution,
weighted summary score) against the vendors to be evaluated.
  •   Functionality: often contains functionality, performance/security, scalability, easy of use and administration,  and integration capability.
  •   Cost: may contain integration cost, support cost, infrastructure cost, contract cost, etc.. Also, you can calculate long run cost i.e. 5 year cost.
  • Service Support: contains information on technical staff support,  web and phone support, documentation, and availability.
  • Technical Architecture: may contain how well the system is designed, the technology used, language support, compliance to your organization standards, portability, reliability, security, performance, auditing, and etc..
  • Execution: involves in evaluating the company's survivability considering its financial assets and market growth in the past, current, and future road map. 
  • The weighted summary scorecard: may contain the percentage of weight you put on key sections as shown in the figure scoresheet2.  
This score sheet can be a excel sheet. For ex: if you want to evaluate portal, see the following excel sheet images that contains the sample score sheet.

Scoresheet1: contains functional, services and support, and technical architecture.

Scoresheet2: contains Execution and Weighted summary score



5. Invite the vendors  for demonstration or proof-of-concept. Evaluate the vendor using the score sheet described above.

6. The vendor with the highest score would be your ideal vendor that can deliver the system/product that meet your business needs. In some cases, you can modify the percentage of weights placed on key sections in the weighted summary score and re-evaluate the vendor.

The above mentioned procurement evaluation process can be used as a framework and a process. There may be better ones but in my experience, following the score card process helped in accomplishing better results.

Monday, October 4, 2010

C# code to query LDAP directory and Active Directory

To query LDAP or AD server with out the domain in the path, see the following code:

public List GetAllUsers(string query)
        {
            var users = new List();
            //ldapServer does not contain the domain i.e. server.company.com 
            using (var dir = new DirectoryEntry(ldapServer, ldapUser, ldapPassword,
                      AuthenticationTypes.ServerBind))
            {
                using (var search = new DirectorySearcher(dir))
                {
                    search.Filter = query;
                    SearchResultCollection resultCol = search.FindAll(); 
                    foreach (SearchResult userProfile in resultCol)
                    {
                        LdapUser user = PopulateUserObject(userProfile);
                        users.Add(user);
                    }
                }
            }
            return users;
        }

To query LDAP or AD server domain, see the following code:

var dir = new DirectoryEntry(adPath, adUser, adPassword)
     { // ad path contains the domain i.e. DC=TEST,DC=Your_COMPANY,DC=COM   
      using (var search = new DirectorySearcher(dir))
      {
       search.Filter = query;
       SearchResultCollection resultCol = search.FindAll(); 
       foreach (SearchResult userProfile in resultCol)
       {
           LdapUser user = PopulateUserObject(userProfile);
           users.Add(user);
       }
      }                                     
      };

To learn more about AuthenticationTypes (part of System.DirectoryServices.dll), go to http://msdn.microsoft.com/en-us/library/system.directoryservices.authenticationtypes.aspx

Wednesday, September 22, 2010

Known ASP.NET vulnarability (Includes MOSS 2007 and 2010) - Microsoft Security Advisory (2416728)

Microsoft published the following vulnerability on their technet site @ http://www.microsoft.com/technet/security/advisory/2416728.mspx  on Sept 20th, 2010.

Executive Summary

Microsoft is investigating a new public report of a vulnerability in ASP.NET. An attacker who exploited this vulnerability could view data, such as the View State, which was encrypted by the target server, or read data from files on the target server, such as web.config. This would allow the attacker to tamper with the contents of the data. By sending back the altered contents to an affected server, the attacker could observe the error codes returned by the server. Microsoft is aware of limited, active attacks at this time.
We are actively working with partners in our Microsoft Active Protections Program (MAPP) to provide information that they can use to provide broader protections to customers.
Upon completion of this investigation, Microsoft will take the appropriate action to help protect our customers. This may include providing a security update through our monthly release process or providing an out-of-cycle security update, depending on customer needs.

For more information, you can read
http://www.microsoft.com/technet/security/advisory/2416728.mspx

After this incident was known, the first impression was that it would not effect MOSS 2007 and MOSS 2010. But that is not true. If you are using MOSS 2007 or 2010, then you have a work around as described in the blog @ http://blogs.msdn.com/b/sharepoint/archive/2010/09/21/security-advisory-2416728-vulnerability-in-asp-net-and-sharepoint.aspx

Please remember that this is only a work around and wait for the ASP.NET security patch release from Microsoft.

Tuesday, September 7, 2010

Why FAST or Google search over MOSS Search 2007/2010?

I was building a search indexer and handler against our enterprise knowledge repository content system a year back. Our knowledge repository has different types of content i.e. structured content like HTML, XML and unstructured content like PDF, MS-WORD, and other office documents. This is when I have learnt the usefulness of search engines like Google and FAST (FAST is now Microsoft owned).  Both Google and FAST have gained a lot of popularity in the last few years. Google (the best in the web search) provides a sharepoint plug-in. FAST has the sharepoint web parts for searching. The advantages of using specially FAST over MOSS search are:

Scalability: Scalablitily is defined in two ways. One way is system scalability and availability i.e. MOSS has only one index server with a single point of failure where as FAST introduces the distributive model (cluster) for indexing. Second way is: Query Scalability i.e. howmany queries per second (QPS) can be handled by a search server? MOSS search server does not define this particular parameter where as FAST claims that it is 1000's QPS.

Navigation: MOSS only supports a shallow faceted search solution by the best bets on the metadata. FAST supports a deep faceted search solution model and therefore provides a slice and dice of the search results through the deep navigation.

Federation: MOSS supports federation with out mixing the results from various data sources and navigation components.Therefore, it displays the results seperately. FAST supports a true (advanced) federation including sending the search queries to different web search APIs and mixing the results. For ex: if you have a site like hotwire or priceline for users to book air line tickets, you have to search different carriers (like Delta ,AA, US Airways, etc..) but also you can provide search results from your partner search sites like orbit, hotwire, and priceline in a unified way.

Relevancy and Ranking (Weights): I have found it very difficult to fine tune the relevancy on search results in MOSS 2007. FAST has a management GUI to setup the rules.

Advanced Indexing and Document Processing: MOSS does not have the capability to index unstructred content like PDF, MS-WORD, or other office documents where as FAST will let you index the unstructred content.

To be completed: Why Google over MOSS?

http://www.google.com/enterprise/whygoogle.html

Other useful resource to learn more about sharepoint search community tool kit,

http://sct.codeplex.com/

Friday, September 3, 2010

How to plan and architect migration projects?

Almost every organization in the universe have to go through the rewrite or migrating their existing  projects or products to a new platform either to increase the business revenue or better fit in to their enterprise infrastructure. Whatever may be the case, if you do not plan and execute correctly, you will end up in a shanty town and waste your investment and resources for no good reason. In the worst case, you will be fired. In my experience, I have seen developers, engineers, and analysts plan their migration with out investing much time upfront in planning and architecture. Most of the times, they want to replicate exactly the same functionality that is existing with out paying any interest in how they can improve the performance, interoperability, portability, reduce the complexity of the integrated systems by loose coupling, increase the ROI, and of course, better the user experience. Probably it is not all their fault as lot of other factors and constraints can guide what you do at work. But, it can cost dearly to the enterprise in the long run. I know a critical project that has been migrated from one platform to other platform and is put in to production. After it reached to production, many issues were seen and fixed at that point of time. After my interactions and interviews with the developers, I have learnt that their primary assigned function is to sit down and code to replicate the functionality of the modules with out considering any bottlenecks. By the time it is realized, luckily it was not too late and most of the performance and architectural issues have been resolved by the project team. Now the question you should ask your self is, do you want be in this position? What point of time in the project you like to address? It is no brainer and we all agree that it should be done upfront? But the million dollar question is... Are developers/analysts/architects doing that?  Therefore, if you are a developer/ analyst and want to become a good technical/business architect ( or have to wear architect hat) then consider the following before starting any coding on your project especially migration projects:

1. Goal of the migration project
2. Understand the scope and vision of migration project and its requirements.
3. Know your business stakeholders and end-users.
4. Think big and out of the box: Remember that your objective is not to replicate the existing architecture and functionality but improving the quality, performance, and experience. Sometimes, business and project manager can only think in one direction and your value will be known to business and IT only if you are innovative.
5. Forget the current architecture for a while and define the target architecture. Also, while defining the target architecture, DO NOT think about the implementation details. You need to consider and understand the following during your design phase:

  •  Data Architecture: define the information flow from point A to point B. Who uses and owns the data?                                        Where is the data stored? and How it is stored? When it is used?
  •  Application Architecture: define the application design, security, development and deployment model, system integration, patterns, and frameworks.
  • Technology Architecture: understand your organization's hardware and network infrastructure. In most cases, your architecture should fit to your organization's hardware and network. In exceptional cases, if necessary, you should be recommending the changes to your existing infrastructure.   

6. Do the risk analysis in both source and target architectures and implementations.
7. Find the gaps, opportunities, and solutions.
8. Choose a SDLC process (waterfall, iterative, or agile) that fits to your organizational culture and project requirements. If you want to follow a complete architectural development lifecycle, frameworks like TOGAF and Zachmann can help you to solidify your process.

9. Understand that a project success depends on what I call "Four C' principles" i.e. Culture, Collaboration, Communication,  and Commitment will let you use your resources i.e. people, processes, tools, and standards in an effective way.