Subscribe: SharePoint SharePoint SharePoint

Sunday, February 9, 2014

10 responsibilities and duties of a SharePoint Administrator

I was working on SharePoint project when my client asked me "What are the duties and responsibilities of a SharePoint Admin ? ". She actually liked SharePoint and wanted to try for getting a job there. Eventually i mailed her all details about a SharePoint Admin, so thought of sharing it with you all !
Powershell


SharePoint Administrator is a person who is solely responsible for configuration and maintenance of a SharePoint Server or a Farm. Promoting user adoption, developing and implementing a governance plan, implementing compliance and discovery, negotiating SLAs, enforcing ownership of applications and sites with stakeholders, collaborating with developers and testing backups is an essential part of a SharePoint Admin's duty.

Roles,Responsibilities and Duties of a SharePoint Admin:

1. Installing, configuring, maintaining, upgrading and managing a SharePoint Server or a Farm.
2. Configuring all service applications like Search, Metadata, UserProfile Synchronization etc.
3. Creation of a Content DB and maintaining it. It involves maintenance of various logging databases in SQL Server. Compressing of logging Databases is also done by SharePoint admins since they grow in size considerably.
4. Assignment of proper permission levels for all users of the site as well as configuring anonymous access if required .
5. Configuring timer jobs depending on business requirements. Timer jobs are very important in SharePoint. One of the timer job is to backup the sites everyday. This is very important as it helps to restore the site to its previous version if any error occurs.
6. Knowledge of powershell is very important for a SharePoint Admin. Clients usually prefer a person who can configure the whole system using powershell since it's much faster than UI. In one of my projects, the whole farm configuration was based on a powershell script which almost took 45-50 minutes to execute. It would have taken hours if the same thing was done using UI.
7. Training and supporting the business users in their day to day involvement in SharePoint sites. For instance uploading a document, starting an approval workflow etc.
8. Solid understanding of IIS, Active Directory and Mail Configuration.
9. Configuration of Business Connectivity Services for connecting to a SQL database or a WCF service.
10. Strong understanding of what can be done using OOB features in SharePoint.

Saturday, February 8, 2014

Content Query Web Part Empty Data Text

In one of the sharepoint projects that i was working on , there was a content query web part which displayed articles from an Articles subsite. There was a filter on the queried data which only showed data as per a metadata term. Now this web part was present in every other subsite. So in some of the sites it showed data while in others since there was not data to be shown, an empty web part was rendered.

SharePoint 2010

Now my client wanted to show a custom  message to the user in the CQWP like :
"No Items are currently available. Please check again soon."

So in order to do this i made some changes to the "ContentQueryMain.xsl" file in :
"\Style Library\XSL Style Sheets\ContentQueryMain.xsl"

There is one template in this file which indicates an "Empty" data. It's called "OuterTemplate.Empty".
I replaced that template with my own code and it worked perfectly fine.So anytime if there was no data to be shown in the CQWP, a custom message was displayed.

The code which i used for the  "OuterTemplate.Empty" template is as follows:
 <xsl:template name="OuterTemplate.Empty">  
     <xsl:param name="EditMode" />  
     <div id="linkitem" class="item link-item">  
       No Items are currently available. Please check again soon.  
     </div>  
       <xsl:if test="$EditMode = 'True' and string-length($cbq_errortext) = 0">  
         <div class="wp-content description">  
           <xsl:value-of disable-output-escaping="yes" select="$cbq_viewemptytext" />  
         </div>  
       </xsl:if>  
   </xsl:template>  

Thursday, February 6, 2014

How to provision Managed Metadata columns in SharePoint

Once i came across a requirement from my client involving creating of a branding package for his SharePoint site in visual studio. Now in this particular package i had to add custom master pages, page layouts, css files, js files etc.

For each page layout i had to create separate content types with some site columns. These site columns too were created in visual studio.

Now one of these site columns was a metadata column i.e. a "Taxonomy Field". I did create the whole package but when i deployed it, i found that metadata columns were not connected to Term Store.

Powershell


Since this was the first time i had worked on this kind of project so was not aware that MMS Term store needs to be connected to a Taxonomy column. I could have done the same using UI, but my client wanted it to be automated.

I came across two approaches to do so. So thought of sharing those:

1. Elements.xml : In elements.xml file of the site column, we can easily specify the termsetid so that the column can connect to term set:

*Here ShowField="Term1033" is necessary field property.
NOTE: You can find the SSPID, GroupId and TermSetID from Term Store Management link in Site Settings.
 <?xml version="1.0" encoding="utf-8"?>  
 <Elements xmlns="http://schemas.microsoft.com/sharepoint/">  
  <Field  
     ID="{99e8cfdc-3edb-4d0e-b22e-0bde0cfe8dfd}"  
     Type="TaxonomyFieldType"  
      DisplayName="LOB"  
      ShowField="Term1033"  
      EnforceUniqueValues="FALSE"  
      Group="Custom"  
      StaticName="LOB"  
      Name="LOB">  
   <Customization>  
    <ArrayOfProperty>  
     <Property>  
      <Name>SspId</Name>  
      <Value  
      xmlns:q1="http://www.w3.org/2001/XMLSchema"  
      p4:type="q4:string"  
      xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">  
       9a5c42de-abb1-489e-87df-c68c2a30c9fc  
      </Value>  
     </Property>  
     <Property>  
      <Name>GroupId</Name>  
      <Value  
      xmlns:q2="http://www.w3.org/2001/XMLSchema"  
      p4:type="q2:string"  
      xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">  
       d86f5d20-8878-4b0d-8ef2-b7a24272e5f3  
      </Value>  
     </Property>  
     <Property>  
      <Name>TermSetId</Name>  
      <Value  
      xmlns:q2="http://www.w3.org/2001/XMLSchema"  
      p4:type="q2:string"  
      xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">  
       3ff7c119-8ad1-4676-b4f0-6d5618840527  
      </Value>  
     </Property>  
     <Property>  
      <Name>AnchorId</Name>  
      <Value  
      xmlns:q3="http://www.w3.org/2001/XMLSchema"  
      p4:type="q3:string"  
      xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">  
       00000000-0000-0000-0000-000000000000  
      </Value>  
     </Property>  
    </ArrayOfProperty>  
   </Customization>  
  </Field>  
 </Elements>  

2. Powershell : If we have already deployed the solution without connecting the columns to term store and we don't not want to change anything in the package. Then we can utilize powershell to connect to the Term Store :

 $centralAdmin = Get-SPWebApplication -IncludeCentralAdministration | Where {$_.IsAdministrationWebApplication} | Get-SPSite  
 $session = new-object Microsoft.SharePoint.Taxonomy.TaxonomySession($centralAdmin)  
 $serviceApp = Get-SPServiceApplication | Where {$_.TypeName -like "*Metadata*"}  
 $termStore = $session.TermStores[$serviceApp.Name]  
 $termSet = $termStore.Groups["Department"].TermSets["IT"]  
 $site = Get-SPSite http://myWebApp/sites/mySite  
 $web = $site.RootWeb  
 $taxonomyField = $web.Fields | Where { $_.Id -eq "99e8cfdc-3edb-4d0e-b22e-0bde0cfe8dfd" }  
 $taxonomyField.SspId = $termSet.TermStore.Id  
 $taxonomyField.TermSetId = $termSet.Id  
 $taxonomyField.AllowMultipleValues = $false  
 $taxonomyField.Update();  

Make sure you specify the GUID of the site column correctly, so that it can connect to the term store.

After following any of the above approaches you can see that the column is connected to Term Store.:

Powershell