Thursday, December 23, 2010

Sharepoint Interviwe Questions Part II

Hi frnz...

i found a site that has sharepoint inerview questions / FAQ's what ever you call them in below URL.
http://www.dotnetspark.com/DotNetQuestion/index.aspx?cate=9

hope it will be useful...

Internet Access for Sharepoint sites

One of the most common scenarios for using sharepoint in organizations is accessing sites from internet for remote users.
To do this there are some simple steps which administrators should care about. Most organizations use firewalls to secure LANs. Steps described here are combination of tasks on firewalls and sharepoint central administration.
1- First of all you have to configure firewall to allow incoming traffic on ports 80 for HTTP and 443 for HTTPS on your server.
2- Open Central Administration and click application management section. Then click Create or Extend Web Application.

3- In new opened page click Extend an Existing web application.

4- Select desired web application that you want to extend for access from Internet.

5- Be sure create a new web site has been selected. Type an appropriate description for new IIS web site. It can be something like Internet Access. Type port 80 and enter your domain name or valid IP address in Host Header. Set file path for IIS web site.


After doing these changes URL field value will automatically change to the value you typed in Host Header field.
For final step select Internet from Zone combo box and then click OK.

After passing these steps you decide to use form authentication or remain on windows integrated authentication.
For users outside organization it could be a good idea to use form authentication with ASPNET Membership provider which gives you the ability to seperates Active Directory users from users coming outside organization. (I’ve placed link to form authentication in previous posts.)

You can also enable anonymous access and give users ability to login. (to know this check this URL: http://blogs.devhorizon.com/reza/?p=498 )

----Plz post your comments, if you find any mistakes in this article. or you can suggest some other best options too.

Hiding the SharePoint Title Field

Problem: When you create lists by default there is a TITLE column created. When a user fills out the list details you don't want this field to be displayed. How can I hide this field?

Solution:

step 1. After creating a SharePoint list, click on List Settings.

step 2: Click on Advanced Settings under General Settings

Step 3: Then, under Content Types - Allow management of content types set it to YES. By default it is NO and click OK.

step 4: You will be then re-directed to the List Settings page and if you notice there is a new option available as Content Types. Click on "Item" under this.

Step 5: You will then see the below screen. Click on "Title" under Columns. As this is a new list I didn't create any additional columns. If you have created any columns you would see them under the Columns section.

Step 6: You will see the below screen and then choose Hidden (will not appear in forms). That's it!.Simple, yes?

This is it!!!! To check, if you go to the list and click on new item you will see that Title is not there...enjoy!!!

Note: This technique also works for other fields. You may also have to remove the Title field from any Views created.

Creating SharePoint Web Part Pages

Problem:
By default, SharePoint (WSS3 and MOSS 2007) builds a main page for every site. However, I would like to have multiple web pages in a particular site so I can build different environments for various projects and teams within a single site.

Solution: It would be common for different teams to want to see different filtered 'views' of the same lists or libraries. To present a set of filtered content to a distinct set of users, you can build a "Web Part Page" for each project or team. Each page can contain multiple web parts of existing content in a filtered view
In this article I will show how to create a Web Part Pages library, creating a few new Web Part Pages, and then describe how different teams can look at the same target (calendar and document) resources using a pre-filtered view for a particular team. These pre-filtered views will show only the data needed for each team.


Step1: In a WSS3 or MOSS 2007 site, click on "View All Site Content" in the Quick Launch area
(left).
Step2: Then click the "Create" link.
Step3: Choose "Document Library" as the object type (you can choose as per your wish also)
Give the document library a name. In a production environment, in the Navigation choice, you may choose to leave this library out of the Quick Launch area and choose a different method of navigating. This option can be changed later. It makes no difference for the purpose of this exercise.
Choose "Web Part Page" as the "Document Template".
--end of creating document library to store webpart pages---
Adding Web Part Pages:
1. In the new library, click the "New" dropdown and choose "New Document".

2. Give the Web Part Page a Title and then choose a desired layout. The little graphic on the bottom left shows an approximation of what the page layout will look like. With just the web browser*, you cannot change the layout style, so be deliberate with the choice. Don't worry too much, you can always just delete the page and create a new one.
(* With SharePoint Designer, you can add or remove Web Part Zones. What's a Web Part Zone? It's the little areas on the Web Part Page where you can place web part objects. Each of these say "Add a web part" when you are in page edit mode.)

3.The next page offers a blank "Web Part Page", where you can add web content as desired.
4. After creating a few of these pages, I end up with a document library that looks with items with your page name.

Introduction to Windows Powershell for SharePoint 2010

Problem : Lately, there has been growing demand for information about Windows Powershell and SharePoint. The reason is because it is so powerful and easy to use. The built-in commands can handle administrative tasks that are just not possible through Central Administration. Although, Powershell can be used for different technologies we will concentrate on the usage of Windows Powershell for SharePoint starting with a brief introduction.
Solution : If you don’t have Powershell installed you can get it from
here. If you are using SharePoint 2010 then it’s a pre-requisite to have this; therefore it will be installed during the installation.
Open Powershell by finding it in your Programs or run "powershell.exe". Once loaded you will see a basic Powershell command prompt


To get a list of all the built-in commands (cmdlets) in Powerhsell just type get-command format-list. (Note: Powerhsell is not case sensitive).
--------
get-command format-list

--------
Notice there is a symbol in the command with a vertical bar "", this is called a Pipe. The Pipe is used to separate different parts of the command. The different parts can be used to include options, formatting or a way to pass variables.
Some examples :
Let’s say you want to list all of the services on your system. This is the simple Powershell command to do this.

--------
get-service
--------
Let’s say you want to list all of the services on your system, sort the list by the status of the service and return the results in a table format . This is the Powershell command to do this.

--------
get-service sort-object status format-table

--------
Passing variables
Let’s say you want to store the data of all the services in variable called "svs".
Variables always start with a $ letting the shell know that it is a variable. So, the commands will be as follows:
--------

$svs=get-process$svs
--------
The first line will store all the running processes in variable "svs". The second line will return all of the data that was stored in the variable "svs".

Interview Questions on Sharepoint

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.

14. 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.

15. 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.

16. 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?
Which version of .NET Framework runtime is required to install Microsoft Office SharePoint server 2007?
In MOSS Capacity Planning documents from Microsoft TechNet, a typical MOSS farm represented as 4x1x1. What does 4 stand for in the representation 4 x 1 x 1?
List 2 out-of-box workflow types that are available in MOSS 2007.
How do you turn on Auditing for a SharePoint List?
Explain how to enable anonymous access to a SharePoint site?
What is Alternate Access Mapping?
What does the "12 hive" mean in SharePoint? Which SharePoint object and method is used to access a SharePoint List item?
Which control(s) should you inherit to create a web part for Windows SharePoint Services v3?
What is the base control that every SharePoint Field control is inherited from?
What is a safe control configuration?
To configure disk-based caching, which element in web.config should be modified?
Please list the port numbers used by the Office Web Services in the MOSS Farm?
Can web parts developed in ASP.NET 2.0 be used in WSS V3 web part pages?
In WSS version 3, IConsumer and IProvider interfaces are made obsolete.
What alternate interfaces are recommended to implement the above to achieve web part communications?
To create a custom router for the Records Center in SharePoint, what interface and method should you implement?
You have developed a new feature called MyNewFeature that depends on the "MyCustomFeature". How do you specificy the dependency in the MyNewFeature feature.xml?•
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?


I will be posting few more questions.......watch this space again.....