Interview Questions administrator

Best SharePoint administrator Interview Questions and Answers with topic wise:


Recycle Bin | MMS | ManagedVsCrawledProperties |

Saturday, February 25, 2012

Microsoft SharePoint workflow Visio template missing:


Just few days back I have installed Visio 2010 professional edition. The Visio 2010 was successfully installed. After that I opened Visio to create workflows by using “SharePoint workflow template” but I didn’t find the SharePoint workflow template. I didn’t get what is the problem. After I put some trail and errors I got the solution. 

Here is the solution for “Microsoft SharePoint workflow Visio template missing
A “SharePoint workflow template” for Visio 2010 is only available with Visio 2010 Premium. That’s the reason they are not available in both Visio 2010 standard and professional editions.

Sharepoint LookUp field issue

The below solution will help you while moving the lists which are having the lookups fileds from one site to number sites.
public const string Parent_Child_LookUpFieldName = "LookupFieldName";
public const string CustomParentList = "ParentList";
public const string CustomChildList = "ChildList";

FixLookupFieldsInList(Parent_Child_LookUpFieldName, currentWeb.Lists[CustomParentList], currentWeb.Lists[CustomChildList]);
#region FixLookupFieldsInList
/// 
/// FUNCTION        : FixLookupFieldsInList
/// PURPOSE         : To fix the LookupFields in a list imported using a stp file
/// PARAMETERS      : currentWeb -> current web
///                   fieldName -> The column name to be fixed
///                   list -> The list to be fixed
///                   targetList -> Then list to which the fieldName must reference
/// RETURNS         : None
/// ---------------------------------------------------------------------
/// 
public static void FixLookupFieldsInList(string fieldName, SPList list, SPList targetList)
{
 try
 {
   list.ParentWeb.AllowUnsafeUpdates = true;
   if (list.Fields.ContainsField(fieldName))
   {                    
    SPFieldLookup field = (SPFieldLookup)list.Fields[fieldName];
    //check if the field link to the list is broken. 
    if (field.LookupList != targetList.ID.ToString())
    {
     //copy the schema from the field
     string newFieldXml = field.SchemaXml;
     string oldsourceid = field.LookupList;
     //put the ID of the current list as the source for the lookup
     field.SchemaXml = newFieldXml.Replace(oldsourceid, "{" + targetList.ID.ToString() + "}");
    }
   }
 }
 catch (Exception ex)
 {
  //Error Handling Code
 }
 finally
 {
   list.ParentWeb.AllowUnsafeUpdates = false;
 }
}
#endregion
Happy coding...

All Client Object model examples

If you want to know/learn about client object model you can get good knowledge on it easily by surfing. But you can’t get the experience on it until unless by doing it practically. It’s my feeling, So I don’t want to share my knowledge, I just want to share my experience to all my SharePoint guys. 

So, here is my practically experience on 3 client object model.
  1. https://sites.google.com/site/sasivalipireddy/clientobjectmodel/SharePoint2010_ECMAScript_Examples.rar
  2. https://sites.google.com/site/sasivalipireddy/clientobjectmodel/SharePoint2010_Manged_ClientOM_Examples.zip
  3. https://sites.google.com/site/sasivalipireddy/clientobjectmodel/SharePoint2010_Silverlight_Examples.zip

Thursday, February 23, 2012

SharePoint interview questions and answers1

1. Document Library - how to set word template as default.
  • By default, it is word template. We can change the template also.
  • Go to document library-->settings-->form library settings-->Advanced settings
  • In that “Template URL” option is there. We can give the path here.
2. Without using “CreateChildControl” is it possible to render a WebPart?
     Yes, by using RenderControl method.

Faster way to search the items in a sharepoint list and libraries:


Using the URL to sort or filter a list or library [or] Filter a SharePoint List with Query String Parameters

Did you know that you easily can filter your SharePoint list or library with values in your URL? That means without using “Views “option. This one’s very useful when you’re having a lot of items in a list or document library and you need a quick filter.

The syntax is as follows:

< URL to List or Library >/Forms/AllItems.aspx?FilterField[X]=[Column to Filter]&FilterValue[X]=[Value]
·          
       [X] is the number of filter's you're applying.  The first set will always be 1, the next set 2, etc.
·         [Column to Filter] is the internal name of the column you wish to filter, such as Title.
·         [Value] is the value you wish to filter on.

How to add a user and multi users to the People picker field in a sharepoint list programmtically


string projectMemberValue = string.Empty;
try
   {
      //To Store Multiple users
      if (spProjectListItem["ProjectMember"] != null)
      projectMemberValue = spProjectListItem["ProjectMember"].ToString();
      SPFieldUserValueCollection oFieldUserValueCollection = new SPFieldUserValueCollection(spDLRWeb,
                                                                                                                    spProjectListItem["ProjectMember"].ToString());
       spListItem["ProjectMember"] = oFieldUserValueCollection;
   }
 catch { }

try
   {
      // To Store Single user.
       if (spProjectListItem["ProjectOwner"] != null)
       projectOwnerValue = spProjectListItem["ProjectOwner"].ToString();
       SPFieldUser userOwnerField = (SPFieldUser)spDLRWeb.Lists["Projects"].Fields.GetField("ProjectOwner");
       SPFieldUserValue fieldOwnerValue = (SPFieldUserValue)userOwnerField.GetFieldValue(projectOwnerValue);
       projectOwner = fieldOwnerValue.User;
    }
 catch { }

Please add comments if it is really helped you or for any issues.

Wednesday, February 22, 2012

How to: Delete a list programtically

#region DeleteBAEList
 /// 
 /// FUNCTION        : DeleteList
 /// PURPOSE         : To delete the list
 /// PARAMETERS      : currentWeb -> current web
 ///                   strListName -> A string containing the list name
 /// RETURNS         : None
 /// -------------------------------------------------------------------------
 /// 
 public static void DeleteList(SPWeb currentWeb, string strListName)
 {
  try
  {
    currentWeb.AllowUnsafeUpdates = true;
    if (IsListExists(strListName, currentWeb) == true)
    {
      SPList lst = currentWeb.Lists[strListName];
      currentWeb.Lists.Delete(lst.ID);
    }
      currentWeb.AllowUnsafeUpdates = false;
  }
  catch (Exception ex)
  {
    //Error Handling Code
  }
}
#endregion


I already covered in my previous posts about how to check whether the specified lists exist or not? And what/why/where we can use “AllowUnsafeUpdates”. 

Refer to get clear idea on it.

Happy Coding....

Add Columns / Fields Programmatically to a SharePoint List

Before adding column(field) to the specified list it’s better to check whether that lists exists or not and new created field already exists or not? In my code, I am checking all these conditions.

SharePoint 15 Technical Preview Download

Microsoft is going to release the next version in SharePoint with the name of SharePoint 15 [i.e. in express mode]. Recently they released the interoperability API Documentation of SharePoint 15 Technical Preview version and it contains what's new. I didn’t go through it and will update once I knew everything.

You can download the SDK from SharePoint 15 Technical Preview Download .

Hope will get more flexibility on it. Thanks to Microsoft team [SharePoint team].


Tuesday, February 21, 2012

How to check if a list exists or not in SharePoint

It’s a very common programming practice to check our newly created list already exists in the specified web or not? Below code will help you on this scenario.

Before adding column(field) to the specified list it’s better to check whether that lists exists or not and new created field already exists or not? In my code, I am checking all these conditions.

How to check if a list template exists or not?

In SharePoint, you will create a list based on existing list template only. Normally, every developer should select “GenericList” template as list template to the newly created lists. Like this way, in my below code I am creating a list based on my custom list template.

How to: Create a list in sharepoint programmatically

Before creating a list it’s better to check your newly created list already exists in the specified web or not and also if you are creating new list by using custom list template, we have to check if list template exists or not also.
Like similar ways, 

Here is the code to create a list in SharePoint programmatically
//To create a list
#region List Template
String ListTemplateName=”CustomListTemplateName”;
String ListName=”CustomListName”;
SPListTemplateCollection listTempColl = currentSite.GetCustomListTemplates(currentSite.RootWeb);
//checking if the list template exists or not before creating a list reason we are creating a custom list using custom template)
if (IsListTemplateExists(ListTemplateName, listTempColl) == true)
 {
   //Creating the custom list using custom list template.
     SPListTemplate listQuickLinksTemp = listTempColl[ListTemplateName];
     CreateList(currentWeb, ListName, "Description of the list", listQuickLinksTemp);
  }
#endregion


#region CreateList
 /// 
 /// FUNCTION        : CreateList
 /// PURPOSE         : To create the list
 /// PARAMETERS      : currentWeb -> current web
 /// strListName    -> A string containing the list name
 /// strlstDesc     -> A string containing the list description
 /// lstTemplate    -> A list template
 /// RETURNS         : None
 /// -----------------------------------------------------------------------
 /// 
 public static bool CreateList(SPWeb currentWeb, string strListName, string strlstDesc, SPListTemplate lstTemplate)
 {
  try
  {
    currentWeb.AllowUnsafeUpdates = true;
    //Checking list exists or not
    if (IsListExists(strListName, currentWeb) == true)
    {
      return false;//list already exists
    }
    else
    {
     //Create the list using template
       currentWeb.Lists.Add(strListName, strlstDesc, lstTemplate);                
       currentWeb.AllowUnsafeUpdates = false;
     }
  catch (Exception ex)
  {
    //Code
  }
  return true;
 }
#endregion
Please refer to get an idea about on what/why/where "AllowUnSafeUpdate".

Thursday, February 16, 2012

SharePoint Unique column constraint:


In SharePoint 2007, we couldn't set unique enforcements to each column or fields to avoid duplicate values in a list or library. "ID" is the only one having unique constraint in SharePoint 2007.

Before to know about enforce uniqueness feature better to get an idea on how can we handle the duplications on list items in SharePoint 2007.

 How can we set the enforce uniqueness to the columns in SharePoint 2007:
Best way to achieve enforce uniqueness to the columns in SharePoint 2007 is event handler. We can handle it by comparing the column values in ItemAdding event.

SharePoint came up with the enforce uniqueness feature. We can handle the enforce uniqueness easily through UI only for the newly created columns.

List Throttling in SharePoint 2010


  1. Request throttling can be used to set the maximum retrieval limit level of the list items from the database.
  2. Best technique to handle large data like when the size of folders and items increases.
  3. One of the best techniques to optimize the performance.
  4. The List view threshold limit is 5000 for users and 20,000 for auditors and administrators.
  5. Possible to set the “Request throttling” limit is at the web applications level only [Go to Administration –> Application Management –> Manage Web Applications –> select site –> General settings menu –> select Resource Throttling].
  6. The way to set the threshold limit from the Development side is by setting the MaxItemsPerThrottledOperationproperty value to the SPWebApplication.
  7. But we can’t set the “Request throttling” limit value at the specific list and library level. The only possible way is either by enabling or disabling the “EnableThrottlingproperty of SPList. By default it is in disable state.
  8. List View Lookup Threshold limit is 8 by default.
When/Where/Why Request Throttling or how it’s handle the performance:

One of the main sources of performance problem in SharePoint is either users or developers writing too many items to a list and then requesting a view or a query that tries to return a large number of items.

How to deploy application pages using sandbox solution in SharePoint 2010

Before deploying the application pages using sandbox solution let me remind you all guys once again because in my interviews experience I have faced these 3 types of questions in most cases. What is mean by "application pages" and where are all the "application pages" have by default and difference between "site pages" and "application pages"?
Site pages are customized pages and are saved into the content database. so when you use the SharePoint designer to make custom changes it saves the changes in to the content database. if you want to make generic pages in a site collection which will be used by everyone, like "settings.aspx" page then you need to use application pages. In other words site pages are nothing but customized pages stored in the content, while application pages are generic pages which will be used by all the sites in a site collection.

External list throttling in SharePoint 2010

 External list Throttling:
Same as internal list throttling, SharePoint also supports External list throttling. External lists are lists that are connected to other systems using BCS and External content type.

If you don't have any idea on list throttling concept, refer this post "List Throttling".

Why throttling for external lists also: sometimes when connecting to backend systems, the backend can take a long time to respond, or you might try to retrieve too many items, overloading the backend. To solve this problem, BCS implements a throttle per connection type whether that is a database or web service that you are connecting to.

Wednesday, February 15, 2012

Migrate lists and libraries from sharepoint 2007 to 2010


We can’t directly deploy or move SharePoint 2007 list and libraries into SharePoint 2010. Because SharePoint server 2010 running on ProductVersion4’, but SharePoint 2007 ProductVersion is ‘3’. That’s the reason we can directly deploy or move SharePoint 2007 list and libraries into SharePoint 2010 server.
Four ways to migrate a list from SharePoint 2007 to 2010 manually,
  1. Using List Template
  2. Using Access table.
  3. Using detach data base.
  4. Using power shell.

Tuesday, February 14, 2012

TCS and HCL SharePoint Interview Questions:

  1.  Connectable WebPart procedure
  2.  Content Retention
  3.  Document Library - how to set word template as default.
  4.  Site Variations(Ans:-Different languages support)
  5.  SharePoint architecture
  6.  LDAP services (Light Weight Directory Access Protocol).
  7.  Single sign on
  8.  About Administration work
  9.  Moss page life cycle
  10.  How to deploy webparts using sharepoint designer?
  11.  What does mean by group policies in sharepoint?
  12.  I want to delete one item in a list at a particular date and time? Which is the best approach to do it?
  13. How to add dropdown control in master page. And how to add content to that drop down menu control (the data is coming from backend database).
  14.  How to perform unit testing?
  15. How to display particular sever control in master page and also that control should be display for the admin only?
  16.  I deployed the features at the site collection level. It will store in site collection folder. How can I hide the deployed "feature" from the site collection feature level?
  17. In WSPBUilder, what is the use of manifest.xml file?
  18. List definitions means?
  19. Page viewer webpart and dataview webpart?
  20. CAS in sharepoint?
  21. How to increase thedll’s trust levels that are placed inside \bin folder. One way is increase the turst level “minimal” to medium”. Can you explain onther way also?
     Will post the answers to the above Questions soon.

TCS SharePoint Interview Questions:

  1.  How to perform unit testing?
  2. How to display particular sever control in master page and also that control should be display for the admin only?
  3. I deployed the features at the site collection level. It will store in site collection folder. How can I hide the deployed "feature" from the site collection feature level?
  4. In WSPBUilder, what is the use of manifest.xml file?
  5. List definitions means?
  6. Page viewer webpart and dataview webpart?
  7. CAS in sharepoint?
  8. How to increase thedll’s trust levels that are placed inside \bin folder. One way is increase the turst level “minimal” to medium”. Can you explain onther way also?
  9. Is it possible to maintain same content DB for more than one web applications?
  10. How to access the outside users without having credentials?
  11. Single sign on means?
  12. I have 2 features. If I activate the one feature, another feature has to activate automatically?
  13. Which of one best: user control or web parts?
Will post the answers to the above Questions soon.

Sonata SharePoint Interview Questions

  1. What do you mean by extending web application?
  2. Use of SSP
  3. WebPart deployments other than solution packaging. Tell something about different package methods.
  4. What is the use of Features?
  5. How do you embed .js files in WebPart
  6. How do you attach external .js file in SharePoint
  7. webusercontrol - how do you put in custom WebPart
  8. Difference site pages/ application pages
  9. How you create master pages(different methods)
  10. How you deploy master pages.
  11. How you configure audience.. all methods
  12. WebPart lifecycle
  13. Different scopes for features
  14. What is farm(SharePoint hosted on multiple machines that behave as a single instance)
  15. Dispose() method in WebPart life cycle
  16. Custom list/ Document library differences
  17. Can you create folders in custom list?
  18. SP designer workflow procedure. tell all steps
  19. Out of the box web parts available in SharePoint
  20. Difference Content query WebPart / Content editor WebPart
  21. Data View WebPart
  22. Master page - default content placeholders
  23. WSS design placeholder. Its use
  24. Namespaces and  classes in object model
  25. How do you create sub sites in object model
  26. Different types of events.
  27. Event receivers and their methods
  28. KPI list WebPart
  29. Approval workflow

Will post the answers to the above Questions soon.

Ramp InfoTech Groups


  1.  List content type and site content type means?
  2. I created one custom Webpart. Now my custom Webpart should display whenever I create a new site.
  3. Difference between solutions and features?
  4. What kind of permission levels need to run the stsadm cmd tool?
  5. How to deploy only .doc files to document library by using event receivers?
  6. Alternative mapping means?
  7. How can you upload collection of documents by using SharePoint object model?
  8. I created one custom Webpart? Now I want deploy it to specific sub site. How can do it?

          Will post the answers to the above Questions soon.