Sunday, May 11, 2014

Out Of Box(OOB) Web Parts in SharePoint 2013

Hi friends,
This blog is about Out of Box (OOB) Web  Parts available in SharePoint 2013. I have just written brief about them. Many of these Web Parts are visible after activating some Site Features and Site Collection Feature.
   1. Apps: all the Apps list and library
   2.    Blog:
 ð  Blog Archive s: Provides quick links to older blog posts.
 ð  Blog Notification: Provides quick links to register for blog posts notifications using Alerts or RSS feed.
 ð  Blog Tools: Provides blog owners and administrators with quick links to common settings pages and content lists for managing a blog site.
   3.    Business Data
 ð  Business Data Actions: Displays a list of actions from Business Data Connectivity
 ð  Business Data Connectivity Filter: Filters the contents of Web Parts using a list of values from the Business Data Connectivity.
 ð  Business Data Item: Displays one item from a data source in Business Data Connectivity.
 ð  Business Data Item Builder: Creates a Business Data item from parameters in the query string and provides it to other Web Parts.
 ð  Business Data List: Displays a list of items from a data source in Business Data Connectivity.
 ð  Business Data Related List: Displays a list of items related to one or more parent items from a data source in Business Data Connectivity.
 ð  Excel Web Access: Use the Excel Web Access Web Part to interact with an Excel workbook as a Web page.
 ð  Indicator Details: Displays the details of a single Status Indicator. Status Indicators display an important measure for an organization and may be obtained from other data sources including SharePoint lists, Excel workbooks, and SQL Server 2005 Analysis Services KPIs.
 ð  Status List: Shows a list of Status Indicators. Status Indicators display important measures for your organization, and show how your organization is performing with respect to your goals.
 ð  Visio Web Access: Enables viewing and refreshing of Visio Web Drawings
   4.    Content Rollup:
 ð  Content Query: Displays a dynamic view of content from your site. It is also known as ContentByQueryWebPart. It aggregates and displays list items within a site hierarchy. In addition to hierarchical query capabilities, the Content Query Web Part provides caching and query optimization for theSPSiteDataQuery object that it contains. Namespace used by Conte query web part is Microsoft.SharePoint.Publishing.WebControls which is available in Microsoft.SharePoint.Publishing.dll. A ContentByQueryWebPart object uses the CrossListQueryCache object to retrieve data. The data retrieved is cleaned and then sent to the XSLT engine. The XSLT engine uses the defaultHeader.xsl, defaultItem.xsl, anddefaultMain.xsl files to translate the data into HTML markup that is presented to the user. You can customize the HTML output of theContentByQueryWebPart by using the XSL transform. TheDataProcessDelegate allows you to retrieve data to be modified before it is sent to the XSLT engine. 
 ð  Content Search: Content Search Web Part will allow you to show items that are results of a search query you specify. When you add it to the page, this Web Part will show recently modified items from the current site. You can change this setting to show items from another site or list by editing the Web Part and changing its search criteria. As new content is discovered by search, this Web Part will display an updated list of items each time the page is viewed.
 ð  Relevant Documents: Displays documents that are relevant to the current user.
 ð  Summary Links: Allows authors to create links that can be grouped and styled.
 ð  Table of Contents: Displays the navigation hierarchy of your site.
 ð  Term Property: Displays the specified property of a Term.
 ð  Timeline: Use this timeline to show a high level view of data from another webpart or tasks list.
 ð  XML Viewer: Transforms XML data using XSL and shows the results.
   5.    Custom:
ð  all the developed web part by developers
   6.    Document Set:
 ð  Document Set Contents: Displays the contents of the Document Set.
 ð  Document Set Property: Displays the properties of the Document Set.
   7.    Forms:
 ð  HTML Form Web Part: Connects simple form controls to other Web Parts.
 ð  InfoPath Form Web Part: Use this Web Part to display an InfoPath browser-enabled form.
   8.    Media and Content:
 ð  Content Editor: Allows authors to enter rich text content.
 ð  Get Started with your site: This web part displays a set of tiles with common SharePoint actions.
 ð  Image Viewer: Displays a specified image.
 ð  Media Web Part: Use to embed media clips (video and audio) in a web page.
 ð  Page Viewer: Displays another Web page on this Web page. The other Web page is presented in an IFrame.
 ð  Picture Library Slideshow Web part:  Use to display a slideshow of images and photos from a picture library.
 ð  Script Editor Web Part: Allows authors to insert HTML snippets or scripts.
 ð  Silver Light Web Part: A web part to display a Silverlight application.
    9.    Performance Point
 ð PerformancePoint filter: This web part displays PerformancePoint filters. Filters may be linked to other web parts to provide an interactive dashboard experience. Filter types include lists and trees based on a variety of data sources.
 ð Performance Point Report: This web part displays PerformancePoint reports. Reports may be linked to other web parts to create an interactive dashboard experience. Report types include: Analytic charts & grids, Strategy Maps, Excel Services, Reporting Services, Predictive Trend charts, and web pages.
 ð PerformancePoint Scorecard: This web part displays a PerformancePoint scorecard. Scorecards may be linked to other web parts, such as filters and reports, to create an interactive dashboard experience.
 ð PerformancePoint Stack Selector: This web part displays a PerformancePoint Stack Selector. All PerformancePoint web parts, such as filters and reports, contained in the same zone will be automatically stacked and selectable using this web part.
   10.SQL Reporting:
 ð   all the report viewer web part
   11.Search:
 ð  Refinement : This webpart helps the users to refine search results
 ð  Search box: Displays a search box that allows users to search for information.
 ð  Search Navigation: This webpart helps the users to navigate among search verticals
 ð  Search Results: Displays the search results and the properties associated with them.
 ð  Taxonomy Refinement Panel: This Web Part helps the user to refine search results on term set data. To use this Web Part, you must also have a Search Data Provider Web Part on this page and use Managed Navigation.
   12.Search-Driven Content:
 ð  Catalog-Item Reuse: Use this Web Part to reuse or republish the content of an item from a catalog.
 ð  Items Matching a Tag: This Web Part will show items that are tagged with a term.
When you add it to the page, this Web Part will show items from the current site matching the page navigation context. You can change this setting to show items from another site or list by editing the Web Part and changing its search criteria. You can also specify whether you want the Web Part to display items associated with a different tag instead.
As new content is discovered by search, this Web Part will display an updated list of items each time the page is viewed.
 ð  Page: This Web Part will show any items that are derived from the Pages content type.
When you add it to the page, this Web Part will show items from the current site. You can change this setting to show items from another site or list by editing the Web Part and changing its search criteria. As new content is discovered by search, this Web Part will display an updated list of items each time the page is viewed.
 ð  Picture: This Web Part will show any items that are derived from the Picture or Image content type. When you add it to the page, this Web Part will show items from the current site. You can change this setting to show items from another site or list by editing the Web Part and changing its search criteria. As new content is discovered by search, this Web Part will display an updated list of items each time the page is viewed.
 ð  Popular Items: This Web Part will show items that have been recently viewed by many users. When you add it to the page, this Web Part will show items from the current site. You can change this setting to show items from another site or list by editing the Web Part and changing its search criteria. You can also customize how items are sorted. As new content is discovered by search, this Web Part will display an updated list of items each time the page is viewed.
 ð  Recently Changed Items: recently. This can help site users track the latest activity on a site or a library. When you add it to the page, this Web Part will show items from the current site. You can change this setting to show items from another site or list by editing the Web Part and changing its search criteria. As new content is discovered by search, this Web Part will display an updated list of items each time the page is viewed.
 ð  Recommended Items: This Web Part will show content recommendations based on usage patterns for the current page. When you add it to the page, this Web Part will show items from the current site. You can change this setting to show items from another site or list by editing the Web Part and changing its search criteria.  As new content is discovered by search, this Web Part will display an updated list of items each time the page is viewed.
 ð   Video: This Web Part will show any items that are derived from the Video content type.  It will sort items by number of views. When you add it to the page, this Web Part will show items from the current site. You can change this setting to show items from another site or list by editing the Web Part and changing its search criteria. As new content is discovered by search, this Web Part will display an updated list of items each time the page is viewed.
 ð  Web Part Page:  This Web Part will show any items that are derived from the Page content type. When you add it to the page, this Web Part will show items from the current site. You can change this setting to show items from another site or list by editing the Web Part and changing its search criteria. As new content is discovered by search, this Web Part will display an updated list of items each time the page is viewed.
 ð  Wiki Page: This Web Part will show any items that are derived from the Wiki Page content type. When you add it to the page, this Web Part will show items from the current site. You can change this setting to show items from another site or list by editing the Web Part and changing its search criteria. As new content is discovered by search, this Web Part will display an updated list of items each time the page is viewed.
   13.Site Collaboration:
 ð  Site Users: Use the Site Users Web Part to see a list of the site users and their online status. When you click a user's name, you see a page that provides information about that user.
 ð  User Task: Displays tasks that are assigned to the current user.ð   Contact Details: Displays details about a contact for this page or site.
 ð  Note Board: Enable users to leave short, publicly-viewable notes about this page. It can be set at project level where some note related to project can be published.
 ð  Organization Browser: This Web Part displays each person in the reporting chain in an interactive view optimized for browsing organization charts.
 ð  Site Feed: Site Feed contains microblogging conversations on a group site.
 ð  Tag Cloud: Displays the most popular subjects being tagged inside your organization.
 ð  User Task: Displays tasks that are assigned to the current user.


Regards
Gireesh Painuly

Tuesday, May 6, 2014

Mostly used powershell command in SharePoint 2013/ SharePoint 2010

Hi Friends,
This blog is about commonly used power shell command used in SharePoint 2013 and SharePoint 2010. I have tested all these commands in SharePoint 2013.

Power shell is executed from SharePoint 2010/2013 management Shell.
è Adding WSP :
ð Farm solution:
               Add-SPSolution -LiteralPath <Path of wsp>
  Eg: Add-SPSolution -LiteralPath c:\contoso_solution.wsp
 
ð Sandbox Solution:
               Add-SPUserSolution –LiteralPath < path of wsp> -site < site ulr>

è Deploy Installed solution
ð Farm Solution:
               Install-SPSolution -Identity <Web part Name.wsp> -GACDeployment
 Eg: Install-SPSolution -Identity contoso_solution.wsp –GACDeployment
 
ð Sandbox Solution:
               Install-SPUserSolution –identity wspfilename.wsp –site <site url>
Eg: Install-SPUserSolution –identity wspfilename.wsp –site <site url>

è Update Existing
ð Farm Solution:
               Update-SPSolution -Identity <wsp name> -LiteralPath <WSP Path> -GACDeployment
 Eg: Update-SPSolution -Identity my.wsp -LiteralPath c:\my.wsp –GACDeployment
 
ð Sandbox Solution:
      Update-SPUserSolution -Identity contoso_solution.wsp -Site http://sitename -ToSolution contoso_solution_v2.wsp
    Eg: Update-SPUserSolution -Identity my.wsp -Site http://sitename -ToSolution myv2.wsp
 
è Uninstall Solution :
ð Farm Solution:
Uninstall-SPSolution [-Identity] <SPSolutionPipeBind> -WebApplication <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-CompatibilityLevel <String>] [-Confirm [<SwitchParameter>]] [-Language <UInt32>] [-Local <SwitchParameter>] [-Time <String>] [-WhatIf [<SwitchParameter>]]
    Eg:     Uninstall-SPSolution –Identity http://sitename contoso_solution.wsp
 
ð Sandbox Solution:
Uninstall-SPUserSolution [-Identity] <SPUserSolutionPipeBind> -Site <SPSitePipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]
 Eg: Uninstall-SPUserSolution -Identity my.wsp -Site http://sitename
 
è Remove Solution:
ð Farm Solution:
Remove-SPSolution [-Identity] <SPSolutionPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-Language <UInt32>] [-WhatIf [<SwitchParameter>]]
Eg:  Remove-SPSolution -Identity contoso_solution.wsp
ð Sandbox Solution:
Remove-SPUserSolution [-Identity] <String> -Site <SPSitePipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]
Eg:  Remove-SPUserSolution -Identity contoso_solution.wsp -Site http://sitename

è Get List of Solution
ð Farm Solution:
                        Get-SPSolution
ð Sandbox Solution:
                        Get-SPUserSolution –Site <site name>

è Install Feature:
ð Farm Solution:
Install-SPFeature [-Path] <String> [-AssignmentCollection <SPAssignmentCollection>] [-CompatibilityLevel <Int32>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
Eg:  Install-SPFeature -path "MyCustomFeature"

è Enable Feature: The Enable-SPFeature cmdlet enables an installed feature at the given scope.
ð Farm Solution:
Enable-SPFeature [-Identity] <SPFeatureDefinitionPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-CompatibilityLevel <Int32>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-PassThru <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
Eg:  Enable-SPFeature -identity "Feature Folder path" -URL http://somesite

è Deactivate Feature:
ð Farm Feature:
Disable-SPFeature [-Identity] <SPFeatureDefinitionPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-Url <String>] [-WhatIf [<SwitchParameter>]]
Eg:  Disable-SPFeature –identity "MyCustom" -URL http://somesite

è Uninstall/ Delete Feature: The Uninstall-SPFeature cmdlet removes the specified feature definition from the collection of feature definitions in the farm.
ð Farm Solution:
Uninstall-SPFeature [-Identity] <SPFeatureDefinitionPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-CompatibilityLevel <Int32>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
Eg: Uninstall-SPFeature -Identity "MyCustomFeature"

è Get List of active features: It displays feature name and corresponding ID:
        Get-SPFeature -Site http://SharePointSite/


è To Delete unused web parts from Solution Store: .webpart file is not deleted from web part gallery after executing above commands, user needs to run bellow command to delete (.webpart) from gallery.

$spQuery = New-Object Microsoft.SharePoint.SPQuery
$camlQuery = '<Where><Eq><FieldRef Name="FileLeafRef" /><Value Type="Text">TestgiriWebPart_GiriWebPart.webpart</Value></Eq>  </Where>'
$spQuery.Query = $camlQuery

$site = Get-SPSite -Identity "http://win-ua50t4mr5s4"
$webpartgallery = $site.GetCatalog( [Microsoft.SharePoint.SPListTemplateType]::WebPartCatalog)
$webparts = $webpartgallery.GetItems($spQuery)
$webparts[0].Recycle()

è To get details about the feature and web application: If you are not sure what Web the feature is activated in, run the following:
                Get-SPSite http://SharePointSite/ | Get-SPWeb -Limit ALL | %{ Get-SPFeature -Web $_ } | Sort DisplayName -Unique | FT DisplayName,Id

è Delete Feature:
      Uninstall-SPFeature <Feature ID>

è To See List of solutions in Solution store:
Stsadm  -o EnumSolutions


è Backup and Restore:
ð Backup SharePoint FARM:
            Backup-SPFarm -Directory <BackupFolder> -BackupMethod {Full | Differential} [-Verbose]
Eg: Backup-SPFarm c:\SPBackup\myfarm.bak –BackupMethod Full

ð Backup Site Collection:
Backup-SPSite -Identity <SiteCollectionGUIDorURL> -Path <BackupFile> [-Force] [-NoSiteLock] [-UseSqlSnapshot] [-Verbose]
Eg: Backup-SPSite –identity http://siteName/ -path c:\mysite.bak –force

è Restore Backup
ð Restore Server Farm:
Restore-SPFarm -Directory <BackupFolder> -RestoreMethod Overwrite [-BackupId <GUID>]
Eg: Restore-SPFarm -Directory \\file_server\share\Backup -BackupId 12345678-90ab-cdef-1234-567890abcdef -RestoreMethod new -ConfigurationOnly

ð  Restore Site Collection:
  Restore-SPSite -Identity SiteCollectionURLHere -Path BackupFilePathHere [-DatabaseServer DatabaseServerNameHere] [-DatabaseName ContentDatabaseNameHere] [-HostHeader HostHeaderHere] [-Force] [-GradualDelete] [-Verbose]
Eg:  Restore-SPSite –identity http://mysite  -path c:\myback.bak -force

è SharePoint list backup: To backup SharePoint list we need to use SharePoint management shell
ð  Exporting List
Export-SPWeb http://www.domain.com -itemurl "/Lists/NameList" -path "c:\test.cmp”
ð  Importing List:
Import-SPWeb http://www.domain.com -Path "c:\test.cmp"

Commonly used power shell command:
ð  Removing Web application
            Remove-SPWebApplication -identity http://sitename –Confirm

ð  Delete Web Application Pool
            Remove-WebAppPool  -name ‘applicationPoolName’
ð  Remove Web Application , Content Database and IIS Application Pool
Remove-SPWebApplication http://sitename -Confirm -DeleteIISSite -RemoveContentDatabases
  
Export list:
# specify the site URL to export

$web = Get-SPWeb "http://testsite:9000"

# specify output folder to store exported lists

$path = "c:\ListBackup\"

foreach($list in $web.lists)
 {
 "Exporting " + $list.RootFolder.URL
 Export-SPWeb $web.URL -ItemUrl $list.URL -path ($path + $list + ".cmp") -nologfile
 }

Export-SPWeb http://tawasul/IT/ISC/ -ItemUrl "/Lists/List_Name" -path "c:\ExportISC\List_Name.cmp"
Export-SPWeb http://mysite/sites/KPI/ -ItemUrl "/Lists/" -path "c:\Export_KPI\List_Name.cmp"
è    Re-Indexing SharePoint List:
UPDATE <Content DB>.dbo.AllListsAux set NextAvailableId=1 where ListID='<GUID>'
eg:
UPDATE WSS_RQMS.dbo.AllListsAux set NextAvailableId=1 where ListID='{500440F9-EEFE-4659-9D33-B90F68404DD4}'
è    Adding Column to existing SharePoint List using powershell:
param([string]$workspaceUrl)
[Microsoft.SharePoint.SPSecurity]::RunWithElevatedPrivileges(
{
$site = SPSite($workspaceUrl)
$web = $site.RootWeb
$spList = $web.Lists["YourList"]
$spFieldType = [Microsoft.SharePoint.SPFieldType]::Text
$spList.Fields.Add("YourColumn",$spFieldType,$false)
$spList.Update()
}
)
To Execute: Save this file in your local drive execute as bellow:
PS C:\Administrator> .\YourScript.ps1 -workspaceUrl "yoururl"
Eg: PS C:\Administrator> C:\MyScript.ps1 -workspaceUrl "http://mymachinename:9000"

è    Create database from power shell:
New-SPConfigurationDatabase [-DatabaseName] <String> [-DatabaseServer] <String> [[-DirectoryDomain] <String>] [[-DirectoryOrganizationUnit] <String>] [[-AdministrationContentDatabaseName] <String>] [[-DatabaseCredentials] <PSCredential>] [-FarmCredentials] <PSCredential> [-Passphrase] <SecureString> [-AssignmentCollection <SPAssignmentCollection>]

è    Changing Site Logo:

$sitename= "http:// dev/sites/SiteName"
$sitelogo= "http:// dev/Site Assets/sitelogo.jpg"
$site=new-object Microsoft.SharePoint.SPSite($sitename)
$web=$site.OpenWeb()
$web.SiteLogoUrl=$sitelogo
$web.Update()
$site.Dispose()

è    Cleanup Deleted Database from SharePoint server:
ð    Display list of all database
Get-SPdatabase
ð    This will list all databases in SharePoint that no longer exist on the database server.
Get-SPDatabase | where {$_.exists -eq $false} :
ð    Remove all orphan database:
Get-SPDatabase | where {$_.exists -eq $false} | foreach {$_.delete()}

è    Get List of Application Pool:
ð    Get list of application Pool:
Get-SPServiceApplicationPool
ð    Delete Application Pool:
Remove-SPServiceApplicationPool-Identity <Name of the application pool>
è    Change Master Page :
$web = Get-SPWeb http://sharepoint
$web.CustomMasterUrl = "/_catalogs/masterpage/seattle.master"
$web.MasterUrl = "/_catalogs/masterpage/ seattle.master"
$web.Update()
è    Get List of Web Application in a Farm:
Get-SPWebapplication
è    Get List of Site collection in a Web Application:
Get-SPWebApplication <WebAppURL> | Get-SPSiteAdministration -Limit ALL| Select url,Title
Eg: Get-SPWebApplication  http:// dev/ | Get-SPSiteAdministration -Limit ALL| Select url,Title
è    List all the Web Application and Site collection and sub sites
Get-SPSite
è    Remove a WebApplication, content database, Application Poo:

Remove-SPWebApplication http://win-2k8-dc7:8081 -Confirm -DeleteIISSite –RemoveContentDatabases
è    To Create new Web Application:

$ap = New-SPAuthenticationProvider -UseWindowsIntegratedAuthentication -DisableKerberos
New-SPWebApplication -Name "WEBAPP" -Port 80 -URL "http://WebAppqa" -ApplicationPool "WEBAPPApplicationPool" -ApplicationPoolAccount (Get-SPManagedAccount "domain\spadmin") -DatabaseName "WSS_Content_WEBAPPRootDB" –AuthenticationProvider $ap
è    To attached SharePoint content database from one server to another server:
ð    Dismount  database from source server:
Dismount-SPContentDatabase [-Identity] <SPContentDatabasePipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]
Eg:
Dismount-SPContentDatabase <database name>
ð    Mount Database to new server:
Mount-SPContentDatabase "<ContentDb>" -DatabaseServer "<DbServer>" -WebApplication http://SiteName
è    Crate Site collection:
New-SPContentDatabase -Name WSS_Content_WEBAPP_TestSite  -WebApplication http://WebApp:8080/
New-SPSite http://WebApp:8080/sites/TestSite -OwnerAlias "domain\sAdmin" -ContentDatabase WSS_Content_WEBAPP_TestSite-Name "TestSite" -Template "PROJECTSITE#0"

Regards
Gireesh Painuly..


Saturday, February 8, 2014

How to Debug Visual Studio Solution in SharePoint

Hi friends, this post about debugging SharePoint solution which are created using Visual Studio 2010 or Visual Studio 2012.
When we create any Visual studio solution for SharePoint and deploy it’s WSP on any environment like QA Environment, Staging and production then some time we require to debug the solution to investigate execution process.
Some time even in Development environment debugging SharePoint site takes much time to reach execution debug point. In such cases we can debug SharePoint solution using IIS process method.
To start debug any SharePoint portal you need to check following things.
 è Check whether your updated solution is deployed in environment (other than Dev Env)
 è Get your latest Visual studio project solution which is deployed in SharePoint site.
Do following step to debug your solution:
iis6.0:
  ð  Run command prompt and navigate to following location:
  c:\Windows\System32>
  ð  Type below command:
     c:\Windows\System32>iisapp.vbs
  ð   Above command will display list of processes id with application pool
  ð  You can easily find the SharePoint portal address with application pool on command prompt.
IIS 7.5:
  ð  Run command prompt and navigate to following location:
    c:\Windows\system32> cd inetsrv
    c:\Windows\system32\inetsrv>appcmd list wp
  ð  Above command will display list of processes id with application pool
  ð  You can easily find the SharePoint portal address with application pool on command prompt.
 è Now go to your Visual studio solution => Debug=>Attach Process
 è Here you will find the list of process id where you need to attach the process id of you SharePoint application pool
 è Once correct process id is attached go to your SharePoint Site and click on the event that you want to monitor.


Related links:
Debug SharePoint Applications 
how to debug sharepoint code 

Happy Debugging 

Sunday, December 1, 2013

The term 'Select-Object' is not recognized as Name of a cmdlet

Hi friends,
This error usually occurs in SharePoint 2013 while running SharePoint 2013 Management Powershell.



This happens due to change in environment variable of “PSModulePath” in windows environment variables
To make it workable you need to perform following actions:
è Log in to the SharePoint Server
è Right click on my computer-> Properties-> Advance System Settings -> Environment Variable
è Scroll your System Variable section-> (PSModulePath) you will find below entry in Variable Value section 
ð  PS Module path:
;c:\Program Files\AppFabric 1.1 for Windows Server\PowershellModules
è append below path in seme line:
;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
è It should look like below:
;c:\Program Files\AppFabric 1.1 for Windows Server\PowershellModules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
 That’s it, now run SharePoint 2013 management shell as administration and you will not see the error

Happy Configuration.....






Saturday, August 24, 2013

Creating Custom Log Out page in SharePoint 2010/ 2013.

Hi friends,
This post is about how to create Custom Log out page in SharePoint. This customization is required when you implement FBA ( Form Based Authentication) or Mix mode authentication in SharePoint. When FBA is implemented with custom Log-in, it does not clear authentication Cookies automatically so to clear authentication cookies we need to do some customization. This customization is done using custom logout page where some block of java-script code is written:

This block of code also helps to prevent error while logging out using FBA.

Following steps are carried out while creating custom log out page in SharePoint with

1.       First Create a logout.aspx using SharePoint Designer
è Open your site using SharePoint designer-> Go to site pages->click on Page button on top ribbon and select ASPX page.
è It will create an aspx page in site pages rename it to Logout.aspx
è Double click on page, it will open page designer, Check Out the page and click on edit file link to open in edit mode.
è Add page title to: Lout out
è Add bellow Script in <head> section:
<script type="text/javascript">
function LogOutBodyOnLoad()
{
try
{
   /* Note : this command is support with only IE  */
  document.execCommand("ClearAuthenticationCache",false);
  window.close(); // It asks to close browser after logout.
  }
  catch (e) { }
 window.location='/_layouts/signout.aspx'; // Redirects to sign out page of SharePoint.
 }
 </script>
è In <body> section change as bellow:
<body onload="LogOutBodyOnLoad ()">
è Check in your Logout.aspx page after performing above changes.
è Next you need to call this Logout.aspx on click of Log out button on Welcom.aspx page that is master page of your site.
è Before change master page you need to check which master page is used by your application to check it go to Site Action->Site setting-Look and feel->Master page. It will show you which master page is used in your application.
è Go to SharePoint Designer -> click on master page in left navigation -> take copy of your master page. If you are working in SharePoint 2013 then you will get ( oslo.htm, oslo.master, seattle.html and seattle.master). Open only ( .html) page in designer and add below script on head section of master page which your application is using. ( check out your master page before editing )
<script type="text/javascript" src="/_catalogs/Scripts/jquery-1.4.1.min.js"></script>
<script type="text/javascript" >
$(document).ready(function(){$("#zz4_ID_Logout").attr("onMenuClick","STSNavigate2(event,'/Site Pages/Logout.aspx');");});
</script>
è Add jquery fie to _catelogs/Scripts using SharePoint designer. If script folder does not exist in _catelogs crate it and add jqury file in it. Check proper version of jquery file with the master page tag.  Jquery file is added in _catelogs using SharePoint designer.
è If you are using SharePoint designer then Id of Logout control may be different, it may be zz3_ID_Logout or zz4_ …. So to get right ID login to your portal and check Source of page, Search for Log out and get right control ID. Replace control ID in Master page’ javascript tag with the right one.


è That’s it now you can login in to your portal and can identify title of log out page after clicking log out button. This could is mainly written to clear authentication cookies after logout.

That's it.. Fell free to ask any question regarding this post.

Happy Coding 
Regards
Gireesh Painuly..