About Me

My photo
Muthupet, TamilNadu, India
SharePoint 2010

Wednesday, May 29, 2013

Downloding wsp from Central Admin


$farm = Get-SPFarm
$file = $farm.Solutions.Item("Sample.wsp").SolutionFile
$file.SaveAs("c:\saravanan\sample.wsp")

Exporting Solutions packages (WSP files) with PowerShell


$dirName = "c:\Exported Solutions"
Write-Host Exporting solutions to $dirName
foreach ($solution in Get-SPSolution)
{
    $id = $Solution.SolutionID
    $title = $Solution.Name
    $filename = $Solution.SolutionFile.Name
    Write-Host "Exporting ‘$title’ to …\$filename" -nonewline
    try {
        $solution.SolutionFile.SaveAs("$dirName\$filename")
        Write-Host " – done" -foreground green
    }
    catch
    {
        Write-Host " – error : $_" -foreground red
    }
}

Tuesday, May 21, 2013

Difference between SharePoint WorkFlow, Event Receivers and Timer Job



I have been asked a lot about the difference between SharePoint Workflows, Event Receivers and Timer Job. When to use each of them, their limitations and of course their advantages.  Before I start the actual explanation, please note that the scenarios or advantages or limitations listed below are only a few from the several others. As there is no limit on usage of SharePoint, similarly there is no limit to use the above mentioned techniques. This article is intended for newcomers who want to start using these techniques but don’t know where to start from.

WorkFlow:

SharePoint Workflow consist a set of task(s) which can be triggered both manually and automatically. In most of the scenarios, Workflows and Event Receives perform the same functionality. SharePoint Workflows are created in SharePoint Designer, Microsoft Visio and of course through Visual Studio. For the beginners, Workflows are the best option to start from as they can be easily created through SharePoint Designer or MS Visio. SharePoint Workflows are used to perform a set of tasks if an item is changed, created, deleted and etc. or in other words the workflow is triggered once an action is completed. The most common examples of workflows are to move an item to another List/Site once it is completed, or to generate custom emails through Workflows and etc.

Event Receivers:

SharePoint Event Receivers as from its name are triggered upon an event. Unlike Workflows, Event Receivers can be triggered even when an item is being created or modified or etc. To create an Event Receiver, you need to use Visual Studio. When it comes to robustness, Workflows are more robust than event receivers. They can survive system reboot and while in few cases Event receivers cant. Unlike Workflows, Event Receivers cannot be triggered manually.

Timer Jobs:

Lastly, SharePoint Timer Jobs. Timer Jobs are triggered both automatically and manually after a defined period. Timer Jobs, like Event Receivers, are created through Visual Studio. Timer Jobs are different from above two in terms that they are triggered only at the mentioned time. They can also be triggered manually but that’s not why they are created. Let’s say you want to assign some administrative tasks to the users on daily or weekly basis, that’s where you use timer job.
Hope fully this brief overview of the above three can help you decide when to use each one of them. If you wish to learn more, do leave comments as we actively reply to your posts.

Friday, May 17, 2013

Accordion using SharePoint 2010

http://www.switchroyale.com/vallenato/

SPD
<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
<script src="vallenato/vallenato.js" type="text/javascript"></script>
<link rel="stylesheet" href="vallenato/vallenato.css" type="text/css" media="screen">

sp content editor webpart

<div id="accordion-container">
     <h2 class="accordion-header">Section 1</h2>
     <div class="accordion-content">
          <p>Section 1 Content</p>
     </div>
     <h2 class="accordion-header">Section 2</h2>
     <div class="accordion-content">
          <p>Section 2 Content</p>
     </div>
</div>

Thursday, May 16, 2013

Branding, Sharepoint 2013

Changing the SharePoint text to something else using PowerShell

Before:

image

After:

image

PowerShell Snippet

1
2
3
$webApp = Get-SPWebApplication http://tozit-sp:2015
$webApp.SuiteBarBrandingElementHtml = "Awesome Text Goes Here"
$webApp.Update()

Enjoy.

Branding, SharePoint 2013

Adding the HMTL Footer markup to the master page
  • Open the master page its HTML file in your favorite text editor (in this example I will use the seattle.html file);
  • Do a search for the s4-workspace DIV, and add a new wrapper DIV underneath it;



Wrapper DIV location
Wrapper DIV location
  • Go straight to the bottom of the HTML file and find the last DIV closing tag;
  • Replace the DIV's closing tag with the following code:



Footer HTML location
Footer HTML location
  • Save the file

Styling your footer

Now that you've added your HTML markup to the master page HTML file, we only need to style the footer.
The CSS markup looks like this:

I paced this CSS code for testing purposes in the following location: "/_layouts/15/images/tests/footer.css".

Sticky Footer Result

The result looks like this:
SharePoint 2013 Footer
SharePoint 2013 Footer

Monday, May 13, 2013

Convert Web application from Classic Mode authentication to Claims based Authentication

What if you already have a Web application created using Classic Mode Authentication or How to convert Web application from Classic Mode authentication to Claims based Authentication?
You don’t have to delete that web application. You can convert that web application from classic mode authentication to claims based authentication. However this can only be done using PowerShell and it’s an irreversible process. Follow PowerShell commands to convert the web application from Classic Mode Authentication to Claims based Authentication:

$App = get-spwebapplication "URL"
$app.useclaimsauthentication = "True"
$app.Update()

Example:

$App = get-spwebapplication “http://FBA:1907”
$app.useclaimsauthentication = “True”
$app.Update()

Thursday, May 9, 2013

CSS to Hide Home Tab in SharePoint 2010 Menu

.s4-tn li.static > a
{
display: none !important;
}
.s4-tn li.static > ul a
{
display: block !important;
}

 

Wednesday, May 8, 2013

Developer Dashboard using Powershell

on

$sp2010 = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings;
$sp2010.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::OnDemand;
$sp2010.RequiredPermissions = 'EmptyMask';
$sp2010.TraceEnabled = $true;
$sp2010.Update();

off

$sp2010 = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings;
$sp2010.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::Off;
$sp2010.Update();

Developer Dashboard using Powershell

on

$sp2010 = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings;
$sp2010.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::OnDemand;
$sp2010.RequiredPermissions = 'EmptyMask';
$sp2010.TraceEnabled = $true;
$sp2010.Update();

off

$sp2010 = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings;
$sp2010.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::Off;
$sp2010.Update();