Wednesday, December 9, 2009

MOSS Governance considerations

Here are some of my key deployment considerations to governance & management.

  • Quota - to encourage storage management, if not manage your disk space and search relevancy
  • Usage Policies - what is ok, SharePoint Designer, Custom web parts, SQL data sources in dataviews, what types of sites do you provision, who can own a site?
  • Data/Site Retention policies - How long does data that isn't accessed or categorized or even used for a couple of years stick around?
  • Web Part/Development policies - Ownership, support, deployment?
  • Meta Data Capture & Content Types - How can you get the best data out of your users?
  • Managed Approach to deployment (top down) - What is our enterprise search story, what is our browse, site map and site directory story... What do the departments in my company use for aggregation?
  • Self Service approach to deployment (bottoms up) - how can I keep Help desk from being a bottleneck to information worker productivity
  • Montoring Plan - Is there a 24/7 plan with a MOM console? What application packs or web services verifications and synthetic transactions for verifiying uptime.
  • Global Considerations - Shared Services, WAN and end user performance levels, enteprise search considerations
  • Cost Model or Charge Back Model for recapture of IT Costs - who pays for all this?
    Solutions Deployment packaging best practices and rules to live by - How can we consistently deploy web parts, site definition changes
  • Branding - how can we consistently have a good experience for our end users and keep the sense of company ownership
  • Stakeholder and ownership - who should be involved in these decisions
  • SSP Delegation models - Who owns Search and relevancy (best bets), who owns the profiles (company directory), who owns the BDC (business data catalog) connections to our SAP, who get's safe locations for Excel published charts, spreadsheets
  • Operational & Service SLAs -
    Backup and Restore/Recovery & Business Continuance SLAs
    Uptime
    Downtime windows
    Performance SLAs
  • Communications plan - who do we communicate to, when and how often and what? Is there a Communications website where we communicate this list of info?
  • End User Education Plan - Is there an FAQ, training materials, brown bags, web sites?

I recommend going through this list, and adding more of your own, then building a governance worksheet or "Green book" that helps bring the stakeholders together.

~ Gangadhar Kotu

Features of MOSS 2010

SharePoint 2010 is the business collaboration platform for the Enterprise and the web that enables you to contact and empower people through an integrated set of rich features. SharePoint 2010 helps you cut costs with a unified infrustructure while allowing you to rapidly respond to business needs.
Features of the new SharePoint 2010
  • New User Interface including the new Ribbon - A streamlined new user interface including the Ribbon is an intuitive and contextual web user interface that makes users more effective. reduces training, provides better performance and lowers cost.
  • Web Edit - Web Edit allows users to easily customize a site, making it possible to respond more quickly than ever to changes in your dynamic business environment.
  • Silverlight Web Part - The Silverlight Web Part allows you to fully integrate Silverlight applications within your SharePoint site for a more interactive user experience.
  • Rich Theming - Combined with Web Edit, rich theming allows you to skin your SharePoint site using your favorite office client themes. Change the colors and fonts to customize just as you like it.
  • Multiple Browser Support - SharePoint 2010 will now support not only MS Internet Explorer, but now FireFox and Safari will also be fully supported.
  • Visio Services - Visio will now be fully supported. You can link diagrams in real time, with high-fidelity in a consistant matter so that everyone can stay up to dat. Even those who do not have Visio.
  • New SharePoint Designer - SharePoint Designer comes with a new User Interface with enhanced modeling capabilities and improved workflows.
  • Business Connectivity Services (The Business Data Catalog) - Business Connectivity Services (BCS) allows you to connect to Line-of-business applications, web services and databases in a user friendly way enabling users to interact and update it easily in both web and office clients.
  • SharePoint Workspace - Formally named Groove, SharePoint Workspace is a rich client for SharePoint that lets you take your SharePoint lists and libraries off-line, including the ability to update content and sync it back when you re-connect.
  • Rich Media Support - Silverlight and PowerPoint presentation capabilities are easily integrated with the new SharePoint 2010. Your information and presentations will come to life in new and dynamic ways with ShjarePoint 2010.

Friday, December 4, 2009

What The World’s Greatest Managers Do Differently

Based on a mammoth research study conducted by the Gallup Organization involving 80,000 managers across different industries, this book explores the challenge of many companies - attaining, keeping and measuring employee satisfaction. Discover how great managers attract, hire, focus, and keep their most talented employees!

Key Ideas:

  1. The best managers reject conventional wisdom.
  2. The best managers treat every employee as an individual.
  3. The best managers never try to fix weaknesses; instead they focus on strengths and talent.
  4. The best managers know they are on stage everyday. They know their people are watching every move they make.
  5. Measuring employee satisfaction is vital information for your investors.
  6. People leave their immediate managers, not the companies they work for.
  7. The best managers are those that build a work environment where the employees answer positively to these 12 Questions:
    1. Do I know what is expected of me at work?
    2. Do I have the materials and equipment I need to do my work right?
    3. At work, do I have the opportunity to do what I do best everyday?
    4. In the last seven days, have I received recognition or praise for doing good work?
    5. Does my supervisor or someone at work seem to care about me as a person?
    6. Is there someone at work who encourages my development?
    7. At work, do my opinions seem to count?
    8. Does the mission/purpose of my company make me feel my job is important?
    9. Are my co-workers committed to doing quality work?
    10. Do I have a best friend at work?
    11. In the last six months, has someone at work talked to me about my progress?
    12. This last year, have I had the opportunity at work to learn and grow?
The Gallup study showed that those companies that reflected positive responses to the 12 questions profited more, were more productive as business units, retained more employees per year, and satisfied more customers.

Without satisfying an employee’s basic needs first, a manager can never expect the employee to give stellar performance. The basic needs are: knowing what is expected of the employee at work, giving her the equipment and support to do her work right, and answering her basic questions of self-worth and self-esteem by giving praise for good work and caring about her development as a person.

The great manager mantra is don’t try to put in what was left out; instead draw out what was left in. You must hire for talent, and hone that talent into outstanding performance.

More wisdom in a nutshell from First, Break All the Rules:
  1. Know what can be taught, and what requires a natural talent.
  2. Set the right outcomes, not steps.
  3. Standardize the end but not the means. As long as the means are within the company’s legal boundaries and industry standards, let the employee use his own style to deliver the result or outcome you want.
  4. Motivate by focusing on strengths, not weaknesses.
  5. Casting is important, if an employee is not performing at excellence, maybe she is not cast in the right role.
  6. Every role is noble, respect it enough to hire for talent to match.
  7. A manager must excel in the art of the interview. See if the candidate’s recurring patterns of behavior match the role he is to fulfill.
  8. Ask open-ended questions and let him talk. Listen for specifics.
  9. Find ways to measure, count, and reward outcomes.
  10. Spend time with your best people. Give constant feedback. If you can’t spend an hour every quarter talking to an employee, then you shouldn’t be a manager.
  11. There are many ways of alleviating a problem or non-talent. Devise a support system, find a complementary partner for him, or an alternative role.
  12. Do not promote someone until he reaches his level of incompetence; simply offer bigger rewards within the same range of his work. It is better to have an excellent highly paid waitress or bartender on your team than promote him or her to a poor starting-level bar manager.
  13. Some homework to do: Study the best managers in the company and revise training to incorporate what they know. Send your talented people to learn new skills or knowledge.
  14. Change recruiting practices to hire for talent, revise employee job descriptions and qualifications.

~ Gangadhar Kotu

Thursday, October 29, 2009

MOSS Interview Questions

1. What does AllowUnsafeUpdates do ?
If your code modifies Windows SharePoint Services data in some way, you may need to allow unsafe updates on the Web site, without requiring a security validation. You can do by setting the AllowUnsafeUpdates property.

C#:
using(SPSite mySite = new SPSite("yourserver"))
{
using(SPWeb myWeb = mySite.OpenWeb())
{
myWeb.AllowUnsafeUpdates = true;
SPList interviewList = myWeb.Lists["listtoinsert"];
SPListItem newItem = interviewList.Items.Add();

newItem["interview"] = "interview";
newItem.Update();
}
}

2. What does RunWithElevatedPrivileges do?
Assume that you have a Web Part in which you want to display information obtained through the Windows SharePoint Services object model, such as the name of the current site collection owner, usage statistics, or auditing information. These are examples of calls into the object model that require site-administration privileges. Your Web Part experiences an access-denied error if it attempts to obtain this information when the current user is not a site administrator. The request is initiated by a nonprivileged user. you can still successfully make these calls into the object model by calling the RunWithElevatedPrivileges method provided by the SPSecurity class.
C#:
SPSite siteColl = SPContext.Current.Site;
SPWeb site = SPContext.Current.Web;
SPSecurity.RunWithElevatedPrivileges(delegate() {
using (SPSite ElevatedsiteColl = new SPSite(siteColl.ID)) {
using (SPWeb ElevatedSite = ElevatedsiteColl.OpenWeb(site.ID)) {
string SiteCollectionOwner = ElevatedsiteColl.Owner.Name;
string Visits = ElevatedsiteColl.Usage.Visits.ToString();
string RootAuditEntries =
ElevatedSite.RootFolder.Audit.GetEntries().Count.ToString();
}
}
});

3.What is a SharePoint Feature? What files are used to define a feature?
A SharePoint Feature is a functional component that can be activated and deactivate at various scopes throughout a SharePoint instances, such as at the farm, site collection, web, etc. Features have their own receiver architecture, which allow you to trap events such as when a feature is installing, uninstalling, activated, or deactivated. The element types that can be defined by a feature include menu commands, link commands, page templates, page instances, list definitions, list instances, event handlers, and workflows.
The two files that are used to define a feature are the feature.xml and manifest file(elements.xml). The feature XML file defines the actual feature and will make SharePoint aware of the installed feature. The manifest file contains details about the feature such as functionality.


4. What are content types ?
A content type is a flexible and reusable WSS type definition that defines the columns and behavior for an item in a list or a document in a document library. For example, you can create a content type for a customer presentation document with a unique set of columns, an event handler, and its own document template. You can create a second content type for a customer proposal document with a different set of columns, a workflow, and a different document template.

5. Workflow can be applied to what all elements of SharePoint ?
While workflow associations are often created directly on lists and document libraries, a workflow association can also be created on a content type that exists within the Content Type Gallery for the current site or content types defined within a list. In short, it can be applied ...
At the level of a list (or document library)
At the level of a content type defined at site scope
At the level of a content type defined at list scope

6. What are the ways to initiate the workflow ?
1. Automatic
2. Manual (standard WSS UI interface)
3. Manual (Custom UI Interface)

7. What are the types of input forms that can be created for a workflow ?
You can create four different types of input forms including an association form, an initiation form, a modification form, and a task edit form. Note that these forms are optional when you create a workflow template.

8. What are ways to create input forms for workflow ?
Two different approaches can be used to develop custom input forms for a WSS workflow template.
a. You can create your forms by using custom application pages, which are standard .aspx pages deployed to run out of the _layouts directory. ( disadv: lot of code required when compared to Infopath approach)
b. using Microsoft Office InfoPath 2007 (disadv: picks up a dependenct on MOSS, i.e. it cannot run in a standalone WSS environment)

9. What is the difference between method activity and event activity in WF ?
A method activity is one that performs an action, such as creating or updating a task. An event activity is one that runs in response to an action occurring.

10. What does SPWeb.EnsureUser method do?
Checks whether the specified login name belongs to a valid user of the Web site, and if the login name does not already exist, adds it to the Web site.
e.g SPUser usr = myWeb.EnsureUser("mmangaldas");

11. While creating a Webpart, which is the ideal location to Initialize my new controls ?
Override the CreateChildControls method to include your new controls. To make sure that the new controls are initialized.. call 'EnsureChildControls' in the webparts Render method. You can control the exact Rendering of your controls by calling the .Render method in the webparts Render method.

12. How to query from multiple lists ?
Use SPSiteDataQuery to fetch data from multiple lists. more details..

13.How Does SharePoint work?
The browser sends a DAV packet to IIS asking to perform a document check in. PKMDASL.DLL, an ISAPI DLL, parses the packet and sees that it has the proprietary INVOKE command. Because of the existence of this command, the packet is passed off to msdmserv.exe, who in turn processes the packet and uses EXOLEDB to access the WSS, perform the operation and send the results back to the user in the form of XML.

13. What is the difference between Syncronous & Asyncronous events?
Syncronous calls ending with 'ing'
E.g. ItemDeleting
Event Handler code execute BEFORE action is committed
WSS waits for code to return
Option to cancel and return error code

Asyncronous calls ending with 'ed'
E.g. ItemDeleted
Event Handler code executes AFTER action is committed
WSS does not wait for code to return
Executed in its own Worker thread.


14. What is ServerUpdate() ?
Any changes in the list, i.e. new addition or modification of an item.. the operation is complete by calling the Update method.

But if a List is set to maintain versions .. and you are editing an item, but don't want to save it as a new version, then use the SystemUpdate method instead and pass in 'false' as the parameter.


15. What is query.ViewAttributes OR How can you force SPQuery to return results from all the folders of the list?

If you use SPQuery on any SPlist .. it will bring back results from the current folder only.
If you want to get results from all the folders in the list.. then you need to specify the scope of the query by the use of ViewAttributes..
e.g. query.ViewAttributes = "Scope=\"Recursive\"";

How Branding can be achieved by Master Pages? What are the advantages or disadvantages of Master Pages?
Does sharepoint provide any way to grant read-only access to all the users of the company on the portal?
What are the steps to create a web-part?
What does the webpart .cab file include?
What are the benefits of using Infopath?
What are the different namespaces per Sharepoint Object Model?
What are the different Back-up and Restore methodologies?
What are the steps in running a custom WebService under the context of SharePoint?
How can you display content from one site in another under the same site collection ?
How to Create a custom list form?

Wednesday, October 28, 2009

Ways of Appreciation

Any form of appreciation makes a person happy and valued. It gives the impression that the employee is efficient and thus deserves some form of acknowledgement. Appreciation does not wait for time or occasion. Whenever the employee delivers commendable work, a small act of appreciation can be a great boost to their morale.

The most common form of appreciation is through gifts or increments. Gifts like chocolates or something that interests the particular employee can be bequeathed. Cash prizes or coupons can be awarded so that the employee gets some extra income. No matter how small the gift is, it can be the biggest motivating factor.

An appreciation letter can be an asset for any employee. It leverages the career prospects of the employee. It portrays that the employee was very good at his/her task and thus can be regarded as a worthy employee.

A simplistic way of appreciating is saying thank you or praising their efforts. As the employee has contributed whole heartedly for the organization, expressing gratitude for the same makes the employee keep up the good work. Also their names can be displayed on notice boards as performers of the month or week.

If a team effort needs to be appreciated, the whole team can be taken out for a pleasure trip or a small feast. Acknowledging them with claps in front of the whole workforce reinforces their spirit. It also instigates others to perform and receive the same commendation.

An efficacious employee longs to receive opportunities to flourish in his/her trade. Training such employees to be better will guarantee fruition to both the company and the employee.

Every employee requires to be appreciated and the medium of appreciation can vary or can be developed. What is important is that the employees receive his/her due as it can make them feel esteemed and execute quality work.

~ Gangadhar Kotu

Saturday, October 17, 2009

Trip to Kurnool flood victims

Today morning, I had booked the tickets to Kurnool and return too. My bus would start by 9PM from Majestic, Bangalore. We had already purchased the items to be distributed to flood victims near by Kurnool.

** I had spent my Diwali time with flood victims in Kurnool areas by distributing some of the needy items. **

17-Oct-2009 7:15 PM Started from my home to Majestic, the bus took more than an hour. At the end the bus was not moving from Majestic theatre. So took a chance to walk down to Majestic bus stand.
17-Oct-2009 8:35 PM I had met the friends Kumar (Actually Kumar is started a new trust called 'SahayamIndia' to service the public, where ever he can) and Mohan there. So the trip started with the efforts of Kumar only. God bless you Kumar.
17-Oct-2009 9:10 PM Actual Journey has been started and probably by 11PM, the bus has been stopped for dinner and had hot hot Roti and Veg curry at Chikka Ballapur area.
18-Oct 2009 6:00 AM got down at Kurnool and doesn't feel like some flood came there and went to Hotel S.V.Regency (for fresh up). While going to hotel through Auto, we were noticed the mud marks on the walls. We were inquired Auto driver (didn't ask his name) about the situation. He was explaining us like "there are areas where the water has come till mid of third floor". We met Mr. Mallikarjun (NGO, from SERUDS, Kurnool) at Hotel and asked us to get ready by 8:00 AM - 8:30 AM. Other friend (Murali) also joined us by 7:15 AM.
18-Oct 2009 8:50 AM, Had a good and nice break fast at Hotel Amaravathi deluxe, which quite opposite to Hotel S.V.Regency.

Post break-fast, we were going by Auto to SERUDS office and kind of struck in traffic jam (also traffic police was present). The traffic jam was because of about more than 50 tractors (>50) were lined up at Agricultural Market Committee Yard. I had inquire with Auto driver (Mr. Reddy) and got to know that they are clearing up all the mud piled up in the yard up to 2 feet.

Yes, we had reached SERUDS office (Location Budhavara Peta)
SERUDS and below is the team namely Kumar Mukkala (Founder of Sahayam India), Gangadhar Kotu, Mohan Vayyala, Muralidhar Reddy. The house almost dried up but no roofAlso checked the stock of items (200kgs of Rice, 100 kgs of Dal, 100 litres of Refined Sunflower Oil, 200 bath soaps, 200 washing soaps).

After 15-20 mins, we wore masks as going to all flood effected areas as a precaution. We have started the camp from here. The following is the map of what areas we had visited.
******* Map image
a. Have been to Mala giri and met the people there. Understood that they have lost everything and some of the houses are not in a position to enter in. Power was still an issue in the houses here. They are getting power only during the day time and no power during night times as the house walls are still wet.
NGO explaining the situation to our Team


b. Have been to Madhiga giri and met the people there. Here there is no big loss to the houses as almost all are buildings.
The house almost dried up but no roof
The areas a &b got flooded with water almost 35-40 feets height and people used small boats to go to the better places. In both the areas the people are daily wages couple of days back. But now, they are workless, homeless, foodless and even hopeless for some days as no one are visiting them and giving a hope. No govt officials are visiting them.
c. Have been to One town and people are still showing the flood marking points.
The house almost dried up but no roof
d. Have been to Kummara veedhi and observed that the Muncipal employees are now trying to clear off the mud from the places. In some of the streets, water was still there which was not even floating. We were observed that they are still cleaning up the bowls (which still had mud...). The area got flooded with water almost 20-25 feets height.
Mud in the placesStill water in the roadsCleaning up the bowls
e. While going towards to Jammi Chettu centre, we have observed that the school was complely with the mud and no one is clearing them. A small picture was taken there and also can be observed the car, books (including Khuran) left unattended.
Muslim SchoolThe house almost dried up but no roofMuslim booksCar in the mud
We just move forward to see how the Tungabadra and Handri rivers were sweeped off the areas. While on the way, my god, it was horrible, we were seeing in TV channels only but upfront here. There was a lorry of goods to be distributed and people are rounded around the lorry and rised up their hands to catch which ever can hold. And the people in the lorry are throwing items (rice, dal, water, ashirwad atta,....) over the air. Somebody are getting them because they are jump and catch them. Some of the goods are ground touched and there are people to even get them.
The house almost dried up but no roofThe house almost dried up but no roof
The following click would give you a real-time feel, who is even trying to get those ground touched food grains.
The house almost dried up but no roof
There was some worse here, somebody scolding her not to pick that grains. But how does the others knows what kind of hungry they are in. Heart touching .. huh?
The following picture shows you what was the level of flood in the river area. You can observe the dry rice leaves (వరి చెత్త) are hanging to the power lines (main grid lines).
The house almost dried up but no roof
You can also observe there are lots of rice bags (wet in flood water) which got wasted during the time.
The house almost dried up but no roof
The following is the cinema hall in that area.
The house almost dried up but no roof
While moving towards Adarsh Nagar/ near by Chanakya puri, I felt like more thirsty and drunk water. We went to Adarsh Nagar (earlier it was posh area) and understood that almost all the houses are getting vacated and moved to other areas even though less affected with the flood (kind of 8feets height). Luckily because of Dasara holidays, the Montissori School was closed otherwise there would have been a big issue to almost 3000 students.

By now, almost the visiting camp was done and back to SERUDS office. We were started packing the items to be distributed. I felt here like the items would not be sufficient for the people. But we were tried our best to serve atleast to some of the people.

We were actually planned to help 100 people and also distributed the tokens to the people. And were involved in packing the items to each. The items in each packet are 2kg of Rice, 1kg of Dal, 1litre of Refined Sunflower Oil, 2 bath soaps and 2 washing soaps.
The house almost dried up but no roof
Once the packing was done, we all went to Hotel Meenakshi and had nice lunch there.
By the time, we were back to office, there are almost 35-40 people are waiting for us in the sunny area. We just took rest for a minute or two and started distributed the packets. Going on fine.. Rajesh is clicking us here..
The house almost dried up but no roof
One woman came who doesn't have a token (means, she is not from the selected area but affected one), so had asked her to wait for sometime by saying "we would give you if anything left". She was scolding, cursing like why don't you select us (people living after the graveyard area; seems to be no one is going that area) also as we also lost everything. Kind of telugu version of the cursings [అయ్యా, మేము సమాధుల అవతల ఉంటాము. మమ్మల్ని ఒక్కడన్నా పట్టించుకోని చావడం లేదు. కనీసం మీరైనా పట్టించుకోండి. ఏఁ మీరైనా పట్టించుకోని చావచ్చు కదా! మాకు ఇవ్వకుండా మీరేమి బాగు పడతారులే? ]
People are coming.. and collecting, ....... coming.. coming & collecting .... ....

In between, there were other 5 women (inlcuding old aged [75-80] beggar) of same kind who doesn't have tokens. We sent 2 of them returned to get the tokens. We were sure that we could really give them but like to wait till all the token holders are collected. But they were not even ready to wait till that time. I personally convinced them to wait for sometime, ofcourse the other woman was waiting since 90 mins to 120 mins time, she had rised up like anything.. you will be destroyed, not get anything... OH MY GOD.. lots of cursings even for the good work (మీరు బాగుపడరు, మీరు నాశనమై పోతారు, ...). We understood her angryness, hunger feel and not to consider her cursings but helped our best with other victims.
4:30 PM, There was no point of waiting for other token holders and given 4 packets to these non-token holders. Still 4 more packets are pending for distribution. We had asked Akshay (attender) to distribute them to other token holders.
4:40 PM, Left from office to Konda Reddy Buruju (the fort from '' movie), Right behind, there was a Police Parade ground (below picture), which was completely gone with the flood.
Police Parade grounds, SP Office
5:10 PM, Went to Tungabadra river. The house almost dried up but no roofThe house almost dried up but no roofCross by, we also a look at ex MLA 'T.G.Venkatesh' house. It was not a house but a modernized fort. It was just on the bank of the river. Even his whole house was filled with flood water. If you see the area outside his house, all are occupied with thick mud of almost 3/4 feet height, which was still unattended and disgusting smell.

I was always being involved in a Public Relation matters (not only here, I did the same when I went to Kakinada fisher men place to distribute general medicine to them in Mar'2005). I was more happy to directly meet the victims and help them with my hands.
I am also in the plans of starting a charitable trust (the name would be "Sanjit Ram Kotu Charitable Trust") to help the poor people, old age people, ....

Happy Service. Serve the needy people. !!

~ Gangadhar Kotu

Tuesday, September 29, 2009

SharePoint Disaster Recovery

It’s Sunday night, and you just got an urgent call from the office: Your Microsoft SharePoint server is down. After some investigation, you find that the disk array in your only front-end web server is dead. You groan, wishing that you'd implemented a complete farm backup from within SharePoint. However, all is not lost. You know that SharePoint stores all its content in a separate SQL Server machine, and that server is fine. You spring into action, trying to get the environment back up before Monday morning. You ask yourself, What steps do I take? What settings will I lose? Will I get any sleep tonight?
This article will answer these questions and more. The recovery I discuss is based on the two-server farm I've mentioned, but the principles also apply to larger farms. The first (crashed) server is running all your SharePoint services (or roles), and the second server is a dedicated SQL Server system. For the purposes of this article, I'm assuming that you're running Microsoft Office SharePoint Server (MOSS) 2007, but most will also apply to Windows SharePoint Services (WSS). I also assume you’re using Windows authentication and Active Directory (AD). Of course, your environment is likely to vary in some way, so these steps won't be applicable to all situations. Toward the end of the article, I’ll also provide you with some recovery recommendations that you can use today to better protect your SharePoint investment.

Recovery Overview

SharePoint stores all content and most of its configuration in SQL Server databases. However, some configuration settings are stored only in Microsoft IIS and various web.config files. Custom code is often stored within the 12 Root (by default, C:\Program Files\Common Files\Microsoft Shared\web server extensions\12) or the global assembly cache. As you’ll see, performing only a SQL Server backup isn't enough to ensure a smooth farm recovery. Perhaps the most significant drawback is that even with many configuration settings stored in a configuration database, this is not recoverable without a SharePoint-based farm backup. (To learn more about SharePoint farm backups, see "Back up a farm by using built-in tools " at technet.microsoft.com/en-us/library/cc263298.aspx.) Nonetheless, you still have recovery options, so let’s start by reviewing what you'll need.

Assess Your Inventory

Let’s review the items you’ll need to proceed with your recovery. Here are the primary items you should identify:

  • You’ll need all your content databases (not including the one for central administration), your Shared Services Provider (SSP) service database, and your search database. All other databases will be re-created.
  • Identify your web applications and the settings that were in use. This should include your portal web application(s), your SSP web application, and your MySites web application, if applicable. Ensure that you know which content database(s) each web application was using. This is a critical reason why basic documentation for your SharePoint environment is so important. If you don’t know or have this, try to remember and document as much as you can; during the recovery, you might experience some trial and error to fit everything back together.
  • Determine your farm's build version, which will tell you what service packs or other updates that have been applied. To get this information when your farm is down, open a query window on your SQL Server system. In the SharePoint config database, run a Select * From Versions command. In the results window, look for the highest value in the version column. Common build numbers are 12.0.0.4518 Original release (RTM), 12.0.0.6219 SP1, 12.0.0.6318 Infrastructure Update, and 12.0.0.6421 SP2.
  • Identify the SharePoint domain service accounts and passwords that were in use. If you’re uncertain what accounts you have, you can obtain them from your SQL Server system's Logins folder. (Note that you might have other login accounts in addition to SharePoint, and you’ll also need to specify which account is used for which service.) If you don’t know the passwords, you can reset them in AD. Here are the domain accounts and a naming convention I often use: setup/admin account (MOSS.Admin); server farm account, aka the database access account (MOSS.Farm); application pool accounts (MOSS.PortalAppPool, MOSS.SSPAppPool); SSP Service account (MOSS.SSPService); Farm Search Service account (MOSS.Search); and Crawler account (MOSS.Crawler).
  • Identify the SharePoint domain service accounts and passwords that were in use. If you’re uncertain what accounts you have, you can obtain them from your SQL Server system's Logins folder. (Note that you might have other login accounts in addition to SharePoint, and you’ll also need to specify which account is used for which service.) If you don’t know the passwords, you can reset them in AD. Here are the domain accounts and a naming convention I often use: setup/admin account (MOSS.Admin); server farm account, aka the database access account (MOSS.Farm); application pool accounts (MOSS.PortalAppPool, MOSS.SSPAppPool); SSP Service account (MOSS.SSPService); Farm Search Service account (MOSS.Search); and Crawler account (MOSS.Crawler).
    Identify any third-party applications and SharePoint Solutions (.wsp files) that will need to be reinstalled.
  • Identify the new physical or virtual server that you'll use as your front-end web server.
  • Ensure that you have your MOSS installation media and license key.

Recovery Steps

Now that you’ve made an inventory of all the necessary components, let’s proceed with the suggested recovery steps. (When you're entering the service accounts in the steps below, I recommend that you precede the accounts with the domain name—for example: domain\MOSS.Farm.)

  1. Install the original OS version on your new server, and don’t be tempted to upgrade the OS at this point. It’s technically possible but adds another level of complexity to your recovery effort. Keep all other settings (e.g., server name, IP address) the same, if possible.
  2. Add the MOSS.Admin account to the local administrators group on the new server. Make sure this account also has logon permissions to your SQL Server system and is a member of the Sysadmin server role.
  3. Remove the previous computer account from AD, join the new server to the domain, and reboot.
  4. Install IIS.
  5. Install the same .NET Framework version that you had on the previous server. At a minimum, this would be version 3.0. If you don’t know, install the latest version, which is version 3.5 SP1, as of this writing.
  6. Install MOSS. Start by logging on as your administrative account (MOSS.Admin). Run the MOSS setup program from your installation media. As with all SharePoint installations, the recommendation is to use the Advanced and then Complete options. These options give you the most flexibility, letting you have this SharePoint server run any roles needed (e.g., Web Application, search) You can install a slipstreamed version provided it isn’t newer than the build you had previously.
  7. Before creating the farm, install all updates to match your previous build version. When doing this, make sure you apply the individual WSS update first and the MOSS update second. For example, to get to build 6318, install in this sequence: WSS SP1, MOSS SP1, WSS Infrastructure Update, MOSS Infrastructure Update. After each update, the SharePoint Products and Technologies Configuration Wizard will start. When it does, simply cancel it.
  8. Once you've applied the updates, you’re ready to create the server farm. Start by launching the SharePoint Products and Technologies Configuration Wizard, which you can access in the Microsoft Office Server group on the Start menu. When prompted, create a new server farm. Next, specify the name of your SQL Server system and the name of your SharePoint config database. If you're using the same database name that you used in your old farm, you must delete the old database first. For the username, enter the name of your server farm account (MOSS.Farm). Click Next, then enter the desired port for the Central Administration Web application and set the proper form of authentication (i.e., NTLM or Kerberos). When you see the summary screen, review it and click Next to create the farm.
  9. Start the Search service. After the farm is created, the Central Administration web site should automatically appear. If the system prompts you to log on, use your MOSS.Admin credentials. To start the search service, first go to the Operations tab and choose Services on server. In the list of services, click Start next to Office SharePoint Server Search. In the resulting dialog box, select both check boxes at the top to make the server an index and query server. For the Farm Search Service Account, enter the appropriate account (e.g. MOSS.Search).
  10. Start any additional services that are in use, such as Excel Calculation Services. For MOSS, you might not need the WSS Search service because it’s used only to index the Help collection.
  11. Re-create each of your Web applications. You’ll need to do this for your SSP Web application, your MySites Web application (if applicable), and each additional Web application that your farm was using. For each one, follow these steps: Go to the Application Management tab, choose Create or extend Web application, then select Create a new Web application. Enter the port and host header. In most cases, you can keep the path as the default. If this web application was using SSL, specify that here. Enter the application pool credentials. In most cases, each web application should use a separate application pool with unique credentials. For example, for the SSP web application, you would use a logon such as MOSS.SSPAppPool. Finally, and most important, enter the name of your SQL Server system and one of the content databases used for this web application. SharePoint will recreate this website in IIS, register it in the new config database, and link it to your existing content database. If you previously extended any of your Web applications (e.g., configured an intranet for extranet access), you should reapply this now.
  12. Associate remaining content databases with your web applications. This step is necessary only if you have multiple content databases for your web applications. Go to the Application Management tab, access Content databases, and select Add a content database. Ensure that you've selected the correct web application at the top, then specify each additional database name.
  13. Restore your SSP. In navigation menu on the left inside Central Administration, click Shared Services Administration, then Restore SSP. For SSP Name, enter in the name of your SSP such as SharedServices1. For Web application, select the Web application that you just created for your SSP. If you were using a separate Web application for My Sites, clear the use existing location check box. If you get warnings here, just acknowledge them and then select the Web application used for My Sites. Next, enter in the SSP Service Credentials (e.g. MOSS.SSPService). Enter in the name of the SSP Database and then the name of the Search Database. Finally, set the desired folder for the index file location. This should be on a drive letter that has plenty of space, so the C: default is not usually a good choice.
  14. Reset IIS. The easiest way to do so is to click Start, Run, and type iisreset.
  15. Reinstall any third-party applications or SharePoint Solutions. These can include custom IFilters (e.g., to index PDF files), custom web parts, and so on. For more information about SharePoint Solutions, see the "Solutions Overview" at msdn.microsoft.com/en-us/library/aa543214.aspx.
  16. Apply any additional configurations. This is the most problematic area because SharePoint changes might occur in a number of ways. Here are some common areas where you might need to make modifications: alternate access mappings (AAM), web.config changes to your web applications, code deployed to bin folders or global assembly cache, IIS settings (e.g., reloading and binding your SSL certificate), changes to 12 Root (e.g., Features or Site Definitions), web application policy settings, and incoming/outgoing email—in general, anything on the Operations tab in Central Administration.
  17. Issue a full crawl of all your content sources, which will recreate SharePoint’s search index. Because your index files were lost on the old server, you must re-crawl. Within your newly restored SSP, click Search settings, then Content sources and crawl schedules. For each content source, select Start Full Crawl from the context menu. Depending on the amount of content, the full crawl can take from minutes to days to complete.
  18. Last, but definitely not least, fully test your SharePoint websites to validate your work. Errors could range from minor web-part problems on pages to full sites not displaying at all. The cause of errors is most likely configuration settings or missing files.

Recommendations

As you can see, not having a SharePoint-specific backup makes the recovery process much more painful, and you run the real risk of ending up with one or more inoperable components. Here are some recommendations that can mitigate this risk and ensure that your recovery is quick and easy.

  • Perform regular SharePoint-specific farm backups. You can do this manually through Central Administration (on the Operations tab, select Perform a backup) or by using the stsadm.exe command-line utility. One advantage to stsadm.exe is that you create a Windows scheduled task to run on a recurring basis. Here's the basic syntax for a full farm backup using stsadm.exe: stsadm -o backup -directory -backupmethod full
  • You must run this command from one of your SharePoint servers, preferably running as your SharePoint admin account. Also, the service account running the MSSQLServer service on your SQL Server system must have Modify permissions to this UNC share and the underlying NTFS folder.
  • Because a farm backup doesn’t include everything, you should also back up your inetpub\wwwroot folders, your 12 Root folder hierarchy, and IIS (for Windows Server 2003, use iisback.vbs; for Windows Server 2008, use appcmd.exe.)
  • For more powerful and granular recovery options, consider third-party backup software such as AvePoint's DocAve, a popular and respected app.
  • When you upgrade the farm (e.g., install SP2), perform a farm backup before and after the upgrade. Creating a backup following an upgrade is recommended because you'll now be at a newer build and previous backups are more difficult to restore.
  • Maintain a configuration change log. This can be a simple document that describes the updates that were made to the farm—for example, upgrading to SP2, installing a custom application, or manually changing a web.config setting. For obvious reasons, don't store this file in SharePoint.
  • For environments that can’t afford downtime, you should build a recovery farm and configure it through step 7 above. (For more information about building a recovery farm, see "Create a recovery farm" at technet.microsoft.com/en-us/library/cc288425.aspx.) Doing so will speed up the recovery. Also, consider an additional web front end and cluster or mirror SQL Server to add additional fault tolerance to your farm. Incidentally, SharePoint is supported in a virtual environment, and it’s common to have a recovery farm in either VMware or Hyper-V.
  • Perform trial restores to your test/recovery farm. Doing so will ensure that your backups are working and that you know how to perform a restore. You really don’t want to learn how to perform a recovery during a disaster on a Sunday night.
  • When deploying custom code to your farm, use SharePoint Solutions. SharePoint Solutions are the best way to deploy custom updates to your farm. If your organization has a development team that is building SharePoint software, insist that they also create a solution package to deploy it.
  • Keep your content databases small. The larger your content databases are, the longer they will take to restore. In general, I recommend keeping each content database under 200GB.
  • Use an intuitive naming convention for your databases. As you can see, you might need to map your content databases to your web applications. Using a naming convention will make that much easier.

Earn Some Rest We've now walked through a SharePoint recovery using only SQL Server databases. Remember that you won’t be able to recover all your configuration settings; however, now that you understand how this kind of recovery works, you should be able to get your farm online within a few hours. Knowing the limitations of a database-only recovery should encourage you to consider additional backup options, along with my other recommendations. Only then can you be sure to get home in time to get some sleep.

Source is here. Happy hours...!!!

~ Gangadhar Kotu (గంగాధర్ కోటు)

Monday, September 28, 2009

Sri Sri Ravi Shankar Ashram trip

With a short notice from friend, I had been to Sri Sri Ravi Shankar Ashram with my friend's car. Today, seems to be lots of rush inside the ashram. Also noticed that there are various religions from India and devotees (Yoga students) are from other countries too.

As I noticed there, everything is commercial and too costly since the Yoga practice to buy anything. But not sure why? Is this a damn good business going on?

Seems to be Sri Sri foundation is going to start a new university in Orissa called 'Sri Sri Ravi Shankar University' by 2010. I asked them like "What is the qualification required to join this university? Does this require Graduation or Post Graduation?" What kind of answers do you expect from them? Wow..... ..... Are you thinking now on this???????

Here are the answers
  • You can do either Graduation or Post Graduation from this University. But this university will be opened in Orissa by 2010.
  • We don't have any brochures on this.
  • Give us some contacts where they can help in contributing funds.
  • Give us any contact who can rise the funds.
I was like surprised to hear the answers from them. I have no word from then when they are stressing on the last two points.

I went to this Ashram almost like 4 years ago. When I had been there last time, there were very less shopping (just underneath the Vishala Mandir). But now, everything is there including any fancy item, ......bags, shirts, trousers, ..........., handicrafts, ... tiffin, snaks, ice creams,... juice, tender coconut,.................... cyber cafe,................. ATMs,............... choultry........ Travel agencies (taxis, bus facility, airlines booking....). What a facility there?

By all, I don't think this is just an Ashram but a great resort. :(

To add this, I donno what to say, but Sri Sri Ravi Shankar came for a visit (in a car) with tight security on to the one round trip of Ashram road (inside) by 5:45 PM. I was expecting him to have a walk by him in the same path. In spite of that he came by car and just went like that even though lots of people are waiting to see him. I doubt everybody can see him during that time.

Well, as he is a Guru of Yoga and Art of Living, if he would have walk down on the path, people would have followed him and he would have become an example (role model) to not to use the vehicles inside the campus and also it would have been a message (No pollution, exercise and relief) to everybody. What happens to his teach (ethics) to everybody in the world.

I feel Sri Sri Ravi Shankar can serve lots of free or at least low price things to the public.

Finally something for free in Ashram is you can have free lunch/dinner. :)

By all means, my understanding that Art of Living is of a full commercial purpose.

~ Gangadhar Kotu

Friday, September 25, 2009

Leave vs Sick Leave

With all my bad experiences over the years, I was thought of writing this post since 2-3 years. But unfortunately couldn't do it. Finally the time has come for this.

In general, I was tried to apply LEAVE in the organization/client place (where ever I was present) very much well in advance. Applying (in advance) leave is becoming an advantage to the project managers and not even thinking of why the resource has applied leave in advance. They simply ignore the leaves and once it is approaching in a day/two/week, they will say "NOT POSSIBLE" because of the unimaginable reasons.
  • Oh, we have got an important work.
  • Oh, no; there is no backup.
  • Oh, sorry, there is a demo to the management.
  • Oh, bad, not possible this time, release is there.
  • Oh, seems to be risky to approve your leave in this crucial time
All the above reasons (Cock-n-Bull stories) seem to be funny to anybody as why the hell managers are there, just to check the mails and play the games with the career of the resources.

Why did the resource apply LEAVE in advance? Just to give manager the opportunity to plan the activities better. To fulfill all the above reasons as the manager can't plan any if he applies just on the day or day before. But What happens to the resource, he gets "NO" answer, which will make him to think of how to get the LEAVE?

Funny part here is, the resource especially receives mails (kind of appreciations like you are an important resource, playing a key role, blah... blah...) in this period of time as to make the resource COOL and Happy.

Funny part is, these managers always maintain their own lobby to know the information (like informer job). Of course these lobby people also gets opportunities if they never raise the voice for any reason.

After lots of instances like above, you will get headache or some or other health issue. You suddenly take a leave and the business (project development, delivery, ...) will never stop as everybody knows. Then the so called manager thinks of all the alternatives and make the work done.

By this time, you would have felt bored, frustrated, irritated, stressed out of your manager activities because of all these CHILDISH behaviors.

You would also try the same instance again but this time wantedly take the sick leave with no reason, no personal work... kind of testing the scenario... what happens at project level. As usual, things will go smoothly. Just a feeling..... :)

Funny result is, if you ever want to have a time off, try consider that day as sick day and inform colleague/manager the same. Nobody has dare to stop/reject this (But there are a half-wit managers where they will bargain the resources to postpone the medical checkups or any doctor appointments..... ..... should be careful with these .... ) . And you could enjoy the day as you like and attend the office next day/two.

Now feeling so better than olden days to get the leave. You got the point where the key lies and use the KEY whenever you feel like.

Just think of, if the manager would have approved the leave by considering the point "Applying the leave in ADVANCE", Do you ever think of SICK LEAVE rather applying for leave?. I'm sure You would never do that. But we everybody knows that these half-wit managers would never apply their brain for these kind of things but apply very much to play the politics.

Of course all the above is an experience with our Indian Project Managers as they have to impress next level, next next level management.

Hope you gotta know how easy to get the leave in this KALIYUGA?


Happy Time...!!

~ Gangadhar Kotu

Thursday, September 24, 2009

Indian Managers Vs Others

With all my experiences, I would like to compare the behaviours/skills of Indian managers and Other Managers (Western countries).



Indian ManagerOther Managers


Happy Time...!!

~ Gangadhar Kotu

Wednesday, September 23, 2009

CAML Queries - Cannot complete action

The Collaborative Application Markup Language (better known as CAML) is an XML-based query language that helps you querying, building and customizing Web sites based on Windows SharePoint Services. The XML elements define various aspects of a WSS site.

The Ground Rule should be either or join operators can only validate two expressions. Once it has more than two expressions in a single or join operator, it cannot be evaluated and throws a strange exception to the users. So, split them in to multiple expressions as below.

General (small example) would throw 'Cannot complete this action' exception:
< "Where" >
< "Or" >
< "Eq" >< name="'Country'/">< type="'LookUp'">India< /Value >< /Eq >
< "Eq" >< name="'Country'/">< type="'LookUp'">China< /Value >< /Eq >
< "Eq" >< name="'Country'/">< type="'LookUp'">Germany< /Value >< /Eq>
< "Eq" >< name="'Country'/">< type="'LookUp'">USA< /Value >< /Eq >
< /Or >
< /Where >

Optimized and to be working:
< "Where" >
< "Or" >
< "Or" >
< "Or" >
< "Eq" >< name="'Country'/">< type="'LookUp'">India< /Value >< /Eq >
< "Eq" >< name="'Country'/">< type="'LookUp'">China< /Value >< /Eq >
< /Or >
< "Eq" >< name="'Country'/">< type="'LookUp'">Germany< /Value >< /Eq>
< /Or >
< "Eq" >< name="'Country'/">< type="'LookUp'">USA< /Value >< /Eq >
< /Or >
< /Where >

In the above working example, you could observe that the join operator has only two expressions at any point of time.

** "Where" should be replaced with Where and "Or" should be replaced with Or. And also spaces shouldn't be there after and before the less than and greater than symbols. As blogger has a limitation, had to place like that.

So, should be very careful while writing CAML query with more values.

Microsoft has to keep an eye on throwing the right error message to the users.

You could also find the above info here

Other Sources:

Happy Coding...!!

~ Gangadhar Kotu

Saturday, September 19, 2009

Client Interview Questions

One fine day, my manager asked me to attend one client interview for a small project. But client wants an Technical Architect for that project. I was wondered why an Architect? Ofcourse, others also wondered. Here are the questions.

  • What are the new features in ASP.Net 3.5 compared to ASP.Net 2.0?
    • Script Manager, Update Panel, Update progress
    • List view, Data Pager
    • LINQ
  • What is LINQ?
    • Language Integrated Query – Used to query the data in the business layer itself to have better performance.
  • What is ListView?
    • ListView is the new control given in the 3.5 framework and can have all the functionalities as like Grid View, DataRepeater with more graphical styles
  • What is the viewstate? What is the lifespan of the same?
    • Viewstate is a built-in page attribute and is used to store the state of the controls.
    • The data is stored in this is encrypted and can be accessed through programmatically.
    • Extra data also can be stored in the viewstate programmatically.
    • The lifespan is the limited to page life time – If the page is alive in the browser the view state also alive along with the page...
  • What is the difference between HTML control and ASP.Net control?
    • HTML control is created at client side and no interactions required with the server.
    • This also can be made interacted with the server by adding runat=”server” attribute.
    • ASP.Net control is created and rendered from server side.
  • What is the difference between web user control and web custom control?
    • Web user control is a control where the user can have visualizations and need to inherit from UserControl class.
    • This can be used in any page to use the functionality.
    • Web custom control -> Not answered.
  • What is the difference between the System Exceptions and Application exceptions?
    • System Exceptions are generic in nature and are intended to thrown by the .net framework.
    • Application Exceptions are the custom exceptions derived from ApplicationException base class and exceptions cover in the developed application.
  • How do you do error handling in ASP.net?
    • Error handling can be done either through web.config of Global.asax files.
    • They can also be page level or application level.
    • They can also be used try … catch… finally….. for the purpose.
    • Errors can also be logged in Event log, text file or database…
  • What is the difference between Response.Redirect, Server.Transfer, Server.Execute and CrossPagePosting?
    • Response.Redirect -> redirect the page to the specified page.
    • Server.Transfer -> Redirect the page to the specified page but the address bar still shows the old URL only.
    • Server.Execute -> Executes the specified URL content.
    • CrosspagePosting -> Not answered.
  • What is a webservice? Advantages of the same?
    • Webservice is a service where it contains the programmable logic and can be accessible via protocols (SOAP).
    • It is very simple and easy to understand.
  • What is SOA?
    • SOA is Service Oriented Architecture. It provides principles of concepts on how the application has to be architecture by having service layers (Application Service layer, Domain Service Layers, Database Service layers ..).
    • Explained the architectural concepts here.
  • How to handle the scenario (given) for Performance?
  • How do you maintain logging in the application?
    • Logs can be maintained in the application with various levels and is used to understand how the application is working.
    • Also will be used to identify the errors.
    • Administering the application is easy if logs are available
  • What are the best practices do you follow?
    • Best practices given here..
  • How do you implement workflow?
    • Workflow can be either sequential or state-machine.
    • Before WWF, used to have roles in Database to execute workflow based applications.
    • Scenario explained here.
Happy interviewing... !!!

~ Gangadhar Kotu

Friday, September 18, 2009

.Net Framework Features

I have been searching in the net where I can get all the features of the .Net framework product. Here is what Microsoft has delivered as a release wise.

.Net 3.5 SP1 Overview

.Net 3.5 Overview

.Net 3.0 Overview

.Net 2.0 Overview
  • 64-bit support
  • Access Control List (ACL) support
  • ADO.Net MSDN
    • Managed Providers
      • Server Enumeration
      • Asynchronous Processing
      • Multiple Active Result Sets (MARS) - Usage
      • Bulk Copy Operations here
      • SQL Server Max data types - varchar(max), nvarchar(max), varbinary(max) - work with large value types
      • SQL Server User-defined types
      • SQL Server notifications
      • Transactions with SQL Server snapshot Isolation usage
      • Database mirroring in SQL Server 2005 here
      • Provider Statistics usage
      • Change password in SQL Server 2005 here
      • Batch Processing
      • Tracing
      • Partial trust
      • Connection Pooling control usage
      • XML Datatype support
      • Integration with System.Transactions and Promotable transactions optimizations for SQL Server 2005
    • Disconnected Classes
      • DataTableReader object usage
      • Binary serialization for DataSet
      • DataTable as a standalone object
      • Create DataTable from DataView object
      • Schema Inference Engine enhancements
      • Namespace qualified Tables
      • Load method for DataTable and DataSet
      • RowState control (new methods SetAdded and Set Modified for DataTable and DataRow)
      • Enhanced support for custom defined types
      • IndexOf method on DataTable.Rows collections.
      • SetOrdinal method to change the position of the column in DataTable.
      • DataView performance improvements
    • Provider-Independent APIs
      • .Net Data provider Enumeration
      • Provider Independent API
      • Schema Discovery
  • ASP.Net here
  • Authenticated streams
  • COM Interop service enhancements
  • Console class additions
  • Data Protection API
  • Debugger display attributes
  • Debugger Edit and continue support
  • Detecting change in Network connectivity (NetworkChange class)
  • Distributed computing
  • Eventlog Enhancements
  • Expanded Certificate Management
  • FTP Support
  • Generics and Generic collections
  • Globalization
  • I/O Enhancements
  • Manifest-based Activation
  • .Net Framework Remoting
  • Obtaining local Network information - System.Net.NetworkInformation class
  • Ping class
  • HttpListener class
  • Programmatic control of caching - System.Net.Cache class
  • C# 2.0 here
  • Visual Basic 2.0 here
  • Security Exception class System.Security.SecurityException
  • I/O device support - SerialPort class
  • Version-tolerant serialization here
  • SMTP support
  • Strongly typed resource support Resource File generator (ResGen.exe)
  • Threading Improvements
  • Trace data filtering
  • Transactions System.Transactions class
  • Web services - asynchronous calls to web methods
  • Windows Forms features
    • ClickOnce deployment here
    • Application Settings here
    • New Data-binding model
    • New controls
      • DataGridView control here
      • ToolStrip control here
      • MaskedTextBox control here
      • SoundPlayer class here
      • SplitContainer control here
      • ListView control enhancements - tile view, grouping and drag-and-drop item repositioning
      • WebBrowser control here
      • FlowLayoutPanel control here
      • TableLayoutPanel control here
      • BackgroundWorker control here
      • Asynchronous Pattern for Components here
  • XML-Related features
    • XmlReader
    • XmlWriter
    • XPathNavigator

.Net 1.1 Overview
  • ASP.Net Mobile controls
  • ADO.Net
    • Data provider for ODBC, namespace System.Data.Odbc
    • DataReader object has "HasRows" property.
    • Connection object has "EnlistDistributedTransaction" method to perform transactions.
  • Side-by-Side execution (MSDN)
  • Security
    • AllowPartiallyTrustedCallersAttribute added to the assemblies System.Web.dll, System.Web.Mobile.dll and System.Web.RegularExpressions.dll (MSDN).
    • <> tag support in web.config for ASP.Net
  • IPv6 Support for Protocols

Happy coding... !!!

~ Gangadhar Kotu

ASP.Net features

I have been searching in the net where I can get all the features of the ASP.Net product. Here is what Microsoft has delivered as a release wise.

ASP.Net 3.5 SP1

ASP.Net 3.5

ASP.Net 3.0

ASP.Net 2.0

ASP.Net 1.1



Happy coding... !!!

~ Gangadhar Kotu

Asset Picker field type

In one of my project, I had to create a field type in MOSS with Asset picker functionality. Custom field types are very useful when you are creating custom functionality in MOSS 2007. The following example shows how to provide a functionality to select the document/list item/ from the site. The would be helpful to the user selecting the URL rather typing everything (there is a possibility of typos :) ). We are going to use 'AssetUrlSelector' class from Microsoft.SharePoint.Publishing.WebControls namespace for the purpose.

Create a custom field class by inheriting from SPFieldText class.

public class RelationshipField : SPFieldText {
// Methods

public RelationshipField(SPFieldCollection fields, string fieldName) : base(fields, fieldName) {}

public RelationshipField(SPFieldCollection fields, string typeName, string displayName) : base(fields, typeName, displayName)

{}

// Properties

public override BaseFieldControl FieldRenderingControl

{

get

{

BaseFieldControl control = new RelationshipFieldControl();

control.FieldName = base.InternalName;

return control;

}

}

}

Create a control class by inherting from BaseFieldControl class. and also need to include the following namespaces.

using Microsoft.SharePoint;

using Microsoft.SharePoint.Publishing.WebControls;

using Microsoft.SharePoint.WebControls;

Here is how the control creation goes:

public class RelationshipFieldControl : BaseFieldControl

{

protected AssetUrlSelector urlSelector;
protected override void OnLoad(EventArgs e)

{

base.OnLoad(e);
// Set the value if this is a postback.

if (this.Page.IsPostBack && base.ControlMode == SPControlMode.Edit)

{

this.ListItemFieldValue = urlSelector.AssetUrl;

}

}
protected override void CreateChildControls()

{

base.CreateChildControls();
// Add the asset picker when in edit mode.

if (base.ControlMode == SPControlMode.Edit)

{

urlSelector = new AssetUrlSelector();

this.Controls.Add(urlSelector);

}

}
protected override void Render(HtmlTextWriter output)

{
// If this is edit mode and has a value, set the picker.

if (base.ControlMode.Equals(SPControlMode.Edit)

&& this.ListItemFieldValue != null)

{

this.urlSelector.AssetUrl = this.ListItemFieldValue.ToString();

}

base.Render(output);

}

}



To register the custom field created above, you need to create a field type definition file as show below. And this xml file needs to be copied to 12\TEMPLATE\XML directory to recognize by MOSS.



asdf

asd

fa

sdf

afwasre

asraqer







Happy Coding... !!




~ Gangadhar Kotu

Wednesday, August 26, 2009

AJAX in MOSS Master pages

Hi,

The procedure is very simple to add <asp:scriptmanager> in Moss master pages.
  1. Add assembly info in SafeControls tag of the respective web.config. If this needs to used across the server farm, then enter in Machine.config. (** not recommended.)
  2. Register assembly in the master page headers before tag.
  3. <%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" Namespace="System.Web.UI" TagPrefix="asp" %>
  4. Add the following after the form tag in body tag.

That's it. You are ready for AJAX development in MOSS.

~ Gangadhar Kotu

Monday, August 3, 2009

Sharepoint Interview Questions

• What is the relationship between Microsoft SharePoint Portal Server and Microsoft Windows Services?
Microsoft SharePoint Products and Technologies (including SharePoint Portal Server and Windows SharePoint Services) deliver highly scalable collaboration solutions with flexible deployment and management tools. Windows SharePoint Services provides sites for team collaboration, while Share Point Portal Server connects these sites, people, and business processes-facilitating knowledge sharing and smart organizations. SharePoint Portal Server also extends the capabilities of Windows SharePoint Services by providing organizational and management tools for SharePoint sites, and by enabling teams to publish information to the entire organization.

• What is a SharePoint Feature? What files are used to define a feature?
A SharePoint Feature is a functional component that can be activated and deactivate at various scopes throughout a SharePoint instances, scope of which are defined as
1. Farm level 2. Web Application level 3. Site level 4. Web level
Features have their own receiver architecture, which allow you to trap events such as when a feature is
Installing, Uninstalling, Activated, or Deactivated.

The element types that can be defined by a feature include
menu commands, link commands, page templates, page instances, list definitions, list instances,
event handlers, and workflows.

The two files that are used to define a feature are the feature.xml and manifest file(elements.xml). The feature XML file defines the actual feature and will make SharePoint aware of the installed feature. The manifest file contains details about the feature such as functionality.

• Workflow can be applied to what all elements of SharePoint ?
Workflow associations are often created directly on lists and libraries, a workflow association can also be created on a content type that exists within the Content Type Gallery for the current site or content types defined within a list. In short, it can be applied ...
At the level of a list/library
At the level of a content type defined at site scope
At the level of a content type defined at list scope

• What are the types of input forms that can be created for a workflow ?
You can create four different types of input forms including
1. An association form
2. An initiation form
3. A modification form
4. A task edit form.

Note that these forms are optional when you create a workflow template.

• What are ways to create input forms for workflow ?
Two
1. You can create your forms by using custom application pages, which are standard .aspx pages deployed to run out of the _layouts directory. ( disadv: lot of code required when compared to Infopath approach)
2. Using Microsoft Office InfoPath 2007 (disadv: picks up a dependenct on MOSS, i.e. it cannot run in a standalone WSS environment)

• What is the difference between method activity and event activity in WorkFlow ?
A method activity is one that performs an action, such as creating or updating a task. An event activity is one that runs in response to an action occurring.

• What are content types?
A content type is a flexible and reusable WSS type definition (or we can say a template) that defines the columns and behavior for an item in a list or a document in a document library. For example, you can create a content type for a leave approval document with a unique set of columns, an event handler, and its own document template and attach it with a document library/libraries.
• Can a content type have receivers associated with it?
Yes, a content type can have an event receiver associated with it, either inheriting from the SPListEventReciever base class for list level events, or inheriting from the SPItemEventReciever base class. Whenever the content type is instantiated, it will be subject to the event receivers that are associated with it.

• What two files are typically (this is kept generally) included when developing a content type, and what is the purpose of each?
There is generally the main content type file that holds things like the content type ID, name, group, description, and version. There is also the ContentType.Fields file which contains the fields to include in the content type that has the ID, Type, Name, DisplayName, StaticName, Hidden, Required, and Sealed elements. They are related by the FieldRefs element in the main content type file.

• What is an ancestral type and what does it have to do with content types?
An ancestral type is the base type that the content type is deriving from, such as Document (0x0101). The ancestral type will define the metadata fields that are included with the custom content type.

• Can a list definition be derived from a custom content type?
Yes, a list definition can derive from a content type which can be seen in the schema.XML of the list definition in the element.

• When creating a list definition, how can you create an instance of the list?
You can create a new instance of a list by creating an instance.XML file

• What is a Field Control?
Field controls are simple ASP.NET 2.0 server controls that provide the basic field functionality of SharePoint. They provide basic general functionality such as displaying or editing list data as it appears on SharePoint list pages.

• What base class do custom Field Controls inherit from?
This varies. Generally, custom field controls inherit from the Microsoft.SharePoint.WebControls.BaseFieldControl namespace, but you can inherit from the default field controls.

• Can multiple SharePoint installs point to the same DB?
Multiple SharePoint installs can use the same database server. Not literally the same database on that server. That server must be SQL Server 2000 or SQL Server 2005. It cannot be Oracle or another vendor.

• How to create links to the mapped network drives?
Creating links to mapped drives in WSS v3 or MOSS 2007 can be done via
the new content type for .lnk files.

• While creating a Web part, which is the ideal location to Initialize my new controls?
Override the CreateChildControls method to include your new controls. You can control the exact rendering of your controls by calling the .Render method in the web parts Render method.
• What are the two base classes a WebPart you are going to use within SharePoint 2007 can inherit from?
There are two base classes that a WebPart which is going to be consumed by SharePoint can inherit from, either the SharePoint WebPart Base class or the ASP.NET 2.0 WebPart base class.
When inheriting from the SharePoint WebPart Base class your derived WebPart class will inherit from Microsoft.SharePoint.WebPartPages.WebPart. When inheriting from the ASP.NET 2.0 WebPart base class your derived WebPart class will inherit from System.Web.UI.WebControls.WebParts.WebPart. It is considered good practice to use the ASP.NET WebPart base class since the old base class is meant for backwards compatibility with previous version of SharePoint, however there are four exception when it is better to leverage functionality from the SharePoint WebPart base class:
Cross page connections
Connections between Web Parts that are outside of a Web Part zone
Client-side connections (Web Part Page Services Component)
Data caching infrastructure

• What are the differences between the two base classes and what are the inherit benefits of using one over another?
The difference is the Microsoft.SharePoint.WebPartPages.WebPart base class is meant for backward compatibility with previous versions of SharePoint. The benefit of using the SharePoint WebPart base class is it supported:
Cross page connections
Connections between Web Parts that are outside of a Web Part zone
Client-side connections (Web Part Page Services Component)
Data caching infrastructure
ASP.NET 2.0 WebParts are generally considered better to use because SharePoint is built upon the ASP.NET 2.0 web architecture. Inheriting from the ASP.NET 2.0 base class offers you features that inherit to ASP.NET 2.0, such as embedding resources as opposed to use ClassResources for deployment of said types.

• What is the WebPartManager sealed class? What is its purpose?
The WebPartManager sealed class is responsible for managing everything occurring on a WebPart page, such as the WebParts (controls), events, and misc. functionality that will occur in WebPartZones. For example, the WebPartManager is responsible for the functionality that is provided when you are working with moving a WebPart from WebPartZone to WebPartZone. It is known as the “the central class of the Web Part Control Set.”

• What does AllowUnsafeUpdates do ?
If your code modifies Windows SharePoint Services data in some way, you may need to allow unsafe updates on the Web site, without requiring a security validation. You can do by setting the AllowUnsafeUpdates property.

• What does RunWithElevatedPrivileges do?
There are certain object model calls model that require site-administration privileges. To bypass access-denied error, we use RunWithElevatedPrivileges property when request is initiated by a nonprivileged user. We can successfully make calls into the object model by calling the RunWithElevatedPrivileges method provided by the SPSecurity class.
• What does SPWeb.EnsureUser method do?
Checks whether the specified login name belongs to a valid user of the Web site, and if the login name does not already exist, adds it to the Web site.
e.g SPUser usr = myWeb.EnsureUser("hitenders");

• What is a SPSite and SPWeb object, and what is the difference between each of the objects?
The SPSite object represents a collection of sites (site collection [a top level site and all its subsites]). The SPWeb object represents an instance SharePoint Web, and SPWeb object contains things like the actual content. A SPSite object contains the various subsites and the information regarding them.

• What does a SPWebApplication object represent?
The SPWebApplication objects represents a SharePoint Web Application, which essentially is an IIS virtual server. Using the class you can instigate high level operations, such as getting all the features of an entire Web Application instance, or doing high level creation operations like creating new Web Applications through code.

• Would you use SPWebApplication to get information like the SMTP address of the SharePoint site?
Yes, since this is a Web Application level setting. You would iterate through each SPWebApplication in the SPWebApplication collection, and then use the appropriate property calls (OutboundMailServiceInstance) in order to return settings regarding the mail service such as the SMTP address.

• How do you return SharePoint List items using SharePoint web services?
In order to retrieve list items from a SharePoint list through Web Services, you should use the lists.asmx web service by establishing a web reference in Visual Studio. The lists.asmx exposes the GetListItems method, which will allow the return of the full content of the list in an XML node. It will take parameters like the GUID of the name of the list you are querying against, the GUID of the view you are going to query, etc.
Side Question: I got asked how I built queries with the lists.asmx web service. In order to build queries with this service, one of the parameters that the GetListItems method exposes is the option to build a CAML query. There are other ways to do this as well, but that was how I answered it.

• When retrieving List items using SharePoint Web Services, how do you specify explicit credentials to be passed to access the list items?
In order to specify explicit credentials with a Web Service, you generally instantiate the web service, and then using the credentials properties of the Web Service object you use the System.Net.NetworkCredential class to specify the username, password, and domain that you wish to pass when making the web service call and operations.

• What is CAML, and why would you use it?
CAML stands for Collaborative Application Markup Language. CAML is an XML based language which provides data constructs that build up the SharePoint fields, view, and is used for table definition during site provisioning. CAML is responsible for rending data and the resulting HTML that is output to the user in SharePoint. CAML can be used for a variety of circumstances, overall is used to query, build and customize SharePoint based sites. A general use would be building a CAML query in a SharePoint WebPart in order to retrieve values from a SharePoint list.

• What is impersonation, and when would you use impersonation?
Impersonation can basically provide the functionality of executing something in the context of a different identity, for example assigning an account to users with anonymous access. You would use impersonation in order to access resources on behalf of the user with a different account, that normally, that wouldn’t be able to access or execute something.

• What are WebPart properties, and what are some of the attributes you see when declaring WebPart properties in code?
WebPart properties are just like ASP.NET control properties, they are used to interact with and specify attributes that should be applied to a WebPart by a user. Some of the attributes you see with ASP.NET 2.0 properties are WebDescription, WebDisplayName, Category, Personalizable, and WebBrowsable. Although most of these properties come from the System.Web.UI.WebControls.WebParts class, ones like Category come out of System.ComponentModel namespace.

• Why are properties important in WebPart development, and how have you exploited them in past development projects? What must each custom property have?
Properties are important because WebParts allow levels of personalization for each user. WebPart properties make it possible for a user to interact, adjust, and increase overall experience value with the programmatic assets that you develop without having the need to use an external editor or right any code. A very simple example of exploiting a property would be something like allowing the user to change the text on the WebPart design interface so that they can display whatever string of text they desire.
Each custom property that you have must have the appropriate get and set accessor methods.

• What are ClassResources? How do you reference and deploy resources with an ASP.NET 2.0 WebPart?
ClassResources are used when inheriting from the SharePoint.WebPart.WebPartPages.WebPart base class, and are defined in the SharePoint solution file as things that should be stored in the wpresources directory on the server. It is a helpful directory to use in order to deploy custom images. In ASP.NET 2.0, typically things such as images are referenced by embedding them as resources within an assembly. The good part about ClassResources is they can help to eliminate recompiles to change small interface adjustments or alterations to external JavaScript files.

• What is a SharePoint Solution File? How does it differ from WebPart .cab files in legacy development? What does it contain?
A SharePoint solution file is essentially a .cabinet file with all a developers custom componets suffixed with a .wsp extension that aids in deployment. The big difference with SharePoint solution files is is that a solution:
allows deployment to all WFE’s in a farm
is highly manageable from the interface allowing deployment, retraction, and versioning
Can package all types of assets like site definitions, feature definitions (and associated components), Webparts, etc.
Can provide Code Access Security provisioning to avoid GAC deployments
And much more..

• What is a .ddf file and what does it have to do with SharePoint Solution creation?
A .ddf file is a data directive file and is used when building the SharePoint solution bundle specifying the source files and their destination locations. The important thing for someone to understand is that the .ddf file will be passed as a parameter to the MAKECAB utility to orchestrate construction of the SharePoint solution file.

• What file does a SharePoint solution package use to orchestrate (describe) its packaged contents?
The solution Manifest.XML file.

• What deployment mechanism can you use to instigate Code Access Security attributes for your WebParts?
SharePoint solution files can add in order to handle code access security deployment issues. This is done in the element in the SharePoint solution manifest.XML, which makes it easier to get assemblies the appropriate permissions in order to operate in the bin directory of the web application.

• What are event receivers?
Event receivers are classes that inherit from the SpItemEventReciever or SPListEventReciever base class (both of which derive out of the abstract base class SPEventRecieverBase), and provide the option of responding to events as they occur within SharePoint, such as adding an item or deleting an item.

• When would you use an event receiver?
Since event receivers respond to events, you could use a receiver for something as simple as canceling an action, such as deleting a document library by using the Cancel property. This would essentially prevent users from deleting any documents if you wanted to maintain retention of stored data.

• What base class do event receivers inherit from?
Event receivers either inherit from the SPListEventReciever base class or the SPItemEventReciever base class, both which derive from the abstract base class SPEventReceiverBase.

• If I wanted to not allow people to delete documents from a document library, how would I go about it?
You would on the ItemDeleting event set: properties.Cancel= true.

• What is the difference between an asynchronous and synchronous event receivers?
An asynchronous event occurs after an action has taken place, and a synchronous event occurs before an action has take place. For example, an asynchronous event is ItemAdded, and its sister synchronous event is ItemAdding


Some items to look at as a developer..
General info on WSS 3.0 development.
http://msdn2.microsoft.com/en-us/library/bb530302.aspx

Application page. Allows the use of inline custom code. Application pages or "_layout" pages are stored on the SharePoint Web server and made available via a Microsoft Internet Information Services (IIS) virtual directory. Though application pages behave much like other ASPX pages and allow the use of inline custom code, they differ from content pages in that they cannot be used to host SharePoint features such as dynamic Web Parts and Web Part zones. For more information, see Creating an Application Page in Windows SharePoint Services 3.0.

WebParts.
http://blogs.tamtam.nl/mart/CreateASharePoint2007WebpartStepByStep.aspx

Server Controls. User Controls on creation and how to install / deploy them.

Content type. A reusable collection of settings to apply to a certain category of content such as documents and folders. Content types are designed to help users organize their SharePoint content in a more meaningful way. For more information, see Introduction to Content Types.

Custom action. Represents a link, toolbar button, menu item, or any control that can be added to a toolbar or menu that appears in the UI. You define custom actions by using a custom action element within a feature definition file. You can bind custom actions to a list type, content type, file type, or programmatic identifier (ProgID). For more information, see Custom Action Definitions.

Event receiver. Evaluator of an event and definer of the behavior of an application. Windows SharePoint Services 3.0 allows you to define event handlers within libraries, lists, and sites. Event receivers can be defined by using a receiver element within a feature definition file. For more information, see Event Registrations.

Feature. A package of Windows SharePoint Services elements that can be activated for a specific scope and that helps users accomplish a particular goal or task. Windows SharePoint Services 3.0 introduces this inherently portable and modular functionality, which simplifies modification of sites through site definitions. For more information, see Working with Features. -- Inside Microsoft Windows Sharepoint Services 3.0

Master page. Pages that provide a consistent layout and appearance (look and feel) for SharePoint sites. They allow you to factor out layout, structure, and interface elements such as headers, footers, navigation bars, and content placeholders. Master pages in ASP.NET 2.0 and master pages in Windows SharePoint Services work in the same way. For more information, see Building Simple Master Pages for Windows SharePoint Services 3.0.

Module. A file or collection of file instances that define the location where the files are installed during site creation. Modules are frequently used to implement a Web Part Page in the site. You can define modules by using a module element within a feature definition file. For more information, see Modules.

Object Model. what is the architecture of sharepoint and how is it represented programmatically. You have to create a webapplication as the first step.. and specify a port number if the default port 80 is already taken. This is not accessible as yet for browsing.. but you can see that a new website is created in the IIS. Next step would be to create a SiteCollection (multiple sitecollection can be created in a single website). Creating a site collection creates a default root site. This root site is accessible through the browser. you can go ahead to create multiple child sites under the root site.
This was the administrative terms used. but for programming, to access the SiteCollection we have to use SpSite and for the Sites we have to use SpWeb.

SharePoint site: A Web site hosted in a virtual URL. A SharePoint site is a place for collaboration, communication, or content storage. Depending on your business needs, you can create sites such as team sites, blog sites, wiki sites, and others. You can customize a site's appearance, users, user permissions, galleries, and site administration by using the Site Settings administration pages.

SharePoint site collection: A collection of SharePoint sites that share common administration pages and site settings. Site collections allow you to share content types, site columns, templates, and Web Parts within a group of SharePoint sites.

SharePoint Web farm: A group of Office SharePoint 2007 servers that share the same configuration database. All site content and all configuration data is shared for all front-end Web servers in a server farm.

Custom List Definition.
http://ari.provoke.co.nz/archive/2007/04/18/creating-a-custom-sharepoint-2007-list-definition.aspx

Site definition. A set of files that includes a master XML configuration file that is stored on all front-end Web servers. A site definition provides the basic blueprint for how sites look, what lists they include, their default navigational structures, and so on. For more information, see Working with Site Templates and Definitions.

Site template. A package containing a set of differences and changes from a base site definition that is created through the UI or through implementation of the object model. The site template package is stored as a .cab-based file that can be downloaded or uploaded to site collections by users with the appropriate rights. Site templates offer a measure of portability to SharePoint applications. For more information, see Working with Site Templates and Definitions.

Solution. A file that is a bundling of all the components for extending Windows SharePoint Services in a particular way. A solution file has a .cab-based format with a .wsp extension. A solution is a deployable, reusable package that can contain a set of Features, site definitions, and assemblies that apply to sites, and that you can enable or disable individually. You can use the solution file to deploy the contents of a Web Part package, including assemblies, class resources, and other package components. For more information see, Solution Overview.

Theme. A group of files (CSS, images) that allow you to define the appearance (look and feel) of Web pages. Themes in ASP.NET 2.0 and themes in SharePoint Products and Technologies work in the same way. Themes are used to help organizations to brand their portals and team sites. Office SharePoint Server 2007 includes a set of predefined themes. However, as a developer, you can create custom themes for your company. For more information, see How to: Customize Themes.

Others
Code Access Security -- general info. (http://msdn.microsoft.com/en-us/library/ms916855.aspx -- SPS 2003 but gives overall info)

HTTPHandlers in Sharepoint.
http://msdn.microsoft.com/en-us/library/bb457204.aspx

Programming Jobs in Sharepoint.
http://msdn.microsoft.com/en-us/library/cc427068.aspx

WWF
Custom Webservices. http://msdn2.microsoft.com/en-us/library/ms464040.aspx .

~ Gangadhar Kotu