Wednesday, February 27, 2013

Change SharePoint Site Title, Description and Icon (Logo) with PowerShell

Its not necessary to continue with the name and description Administrators provides during the creation of the site, isn't it?  Let's see how we can change SharePoint site's Title, Description and Icon (Logo) from SharePoint Interface as well as using PowerShell.

How to Change Logo from SharePoint Web Interface?

Go to Site Actions >> Site settings >> Click on Title, description, and icon Link under "Look and Feel", Change the name and description as per your requirements!
Change SharePoint Site Title, Description and Icon with PowerShell
Change SharePoint Site Title, Description and Icon with PowerShell
#Get the Web
$Web= Get-SPWeb "http://your-sharepoint-site.com" 

#Set the Title & Description
$Web.Title = "Marketing Portal" 
$Web.Description = "Marketing Portal" 

#You can change the Quick Launch/Treeview navigation also (If its not a Publishing site):
$Web.TreeViewEnabled = $True 

#Update the changes
$web.Update()

How to Change Logo in SharePoint 2010 Site
When we create SharePoint sites, it comes with a default logo image from: /_layouts/images/siteIcon.png(SharePoint applies this logo when LogoURL property is empty!) .We can change it to reflect our own branding, so that it can be easily recognized. I needed to apply new logo for all SharePoint sites during a corporate re-branding project.

Instead of manual way, I want to do this change with PowerShell script to update all site collection's Logo icons. Here is my quick PowerShell script to apply and verify the logo for all SharePoint sites:

#Get the Site
$web = Get-SPWeb "http://your-sharepoint-site.com"

#Set Site Logo Icon
$web.SiteLogoUrl = "http://your-sharepoint-site.com/SiteAssets/Corp-logo.png"

#Set Logo Description
$web.SiteLogoDescription = "Corporate Logo for Your Company"

#To Set Alternate CSS URL, Use:
#$Web.AlternateCssUrl = "/_layouts/1033/styles/CustomStyles.css

#Update the changes
$web.Update()

Logo can be from any SharePoint Library (such as Assets Library), Make sure all users have read access to the Logo file. Or it can be from 14 Hive's Images Folder (Recommended!) "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES".Once uploaded, We can refer it by providing URL: /_layouts/images/YourLogo.png

Important: When you place Logo Inside Images folder, Make sure its inheriting security (Go to Logo file's Properties >> Security >> Advanced >> Make sure "Include Inheritable Permissions from this object's Parent" is selected. If not, Click on "Change Permissions" button and enable "Include Inheritable Permissions from this object's Parent")! otherwise, End-users may get Log-on prompts and page may stop loading.
If you have multiple servers in your farm, You must upload this Logo image in each Web Front End Server!

To Get Logo Information of entire web application:
Get-SPWebApplication "http://your-sharepoint-URL.com" | Get-SPSite | Get-SPWeb | 
 foreach { "Site "+ $_.Url + " Logo URL: " +  $_.SiteLogoUrl }

To Change Logo For All Sites in a Web Application:
Get-SPWebApplication "http://your-sharepoint-URL.com" | Get-SPSite | Get-SPWeb | 
  foreach { $_.SiteLogoUrl = "/_layouts/Images/Corp-Logo.png"; $_.Update() }

To Change Logo for All sites in a Site Collection:
Get-SPSite "http://your-sharepoint-URL.com" | Get-SPWeb | 
   foreach { $_.SiteLogoUrl = "/_layouts/Images/Corp-Logo.png"; $_.Update() }

Ideally, Its a best practice to apply Logos as part of Branding.

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Tuesday, February 26, 2013

Create Update Copy Delete SharePoint Views with PowerShell

Requirement is: There are lot of document libraries in a SharePoint site. Periodically, in all libraries there is a need to:
  • Create a new view
  • Update an existing view with new filter condition
  • Create new new by copying existing view and modify the filter
  • Delete an existing view
  • Add new field to existing view
Team wanted to automate the process of creation of new SharePoint list views, Deleting existing views, Update filters on existing views and copy existing views. Wrote PowerShell code to do the above:

Create SharePoint List View in PowerShell:
#Function to create new View
Function CreateNewView()
 {  
  Param( [Parameter(Mandatory=$true)] [string]$SiteURL, [Parameter(Mandatory=$true)] [string]$ListName, [Parameter(Mandatory=$true)] [string]$ViewName ) 
  
  $site = Get-SPSite $SiteURL
  $web = $site.openweb()
  
  #Get the List
  $list=$web.lists[$ListName]
  
   #View Fields 
   $viewFields = New-Object System.Collections.Specialized.StringCollection
   
   #Add fields to the view
   $viewFields.Add("Global Entity") > $null
   $viewFields.Add("Document Type")> $null
   $viewFields.Add("Risk")> $null
   $viewFields.Add("Year")> $null

    #Set View options
    $viewRowLimit="100"
    $viewPaged=$true
    $viewDefaultView=$false
    $viewQuery="<Where><Eq><FieldRef Name='Document_x0020_Type' /><Value Type='Choice'>Customer Reconciliation</Value></Eq></Where>"

    #Crete new view
    $newview = $list.Views.Add($ViewName, $viewFields, $viewQuery, $viewRowLimit, $viewPaged, $viewDefaultView)

   #Send message to output console
   write-host "New View $($ViewName) Created Successfully!" -foregroundcolor green 

  $web.Dispose()          
  $site.Dispose()          
 }

Update Existing SharePoint View with PowerShell:
#Function to Update Existing View
Function UpdateViewFilter()
 {  
  Param( [Parameter(Mandatory=$true)] [string]$SiteURL, [Parameter(Mandatory=$true)] [string]$ListName, [Parameter(Mandatory=$true)] [string]$ViewName, [Parameter(Mandatory=$true)] [string]$ViewQuery ) 
  
  $site = Get-SPSite $SiteURL
  $web = $site.openweb()
  #Get the List
  $list=$web.lists[$ListName]
  #Get the View
  $view = $list.Views[$ViewName]
  
  #Update the view
  if($view -ne $null)
  {
   $view.Query = $ViewQuery
   $view.Update()
   $list.update()
   #Send message to output console
   write-host "View $($ViewName) Updated Successfully!" -foregroundcolor green 
  }
  else
  {
   write-host "Could Not find: $($ViewName)!" -foregroundcolor red 
  }
  $web.Dispose()          
  $site.Dispose()          
 }

Copy SharePoint list view in PowerShell:
#Function to Update Existing View
Function CopyView()
 {  
  Param( [Parameter(Mandatory=$true)] [string]$SiteURL, [Parameter(Mandatory=$true)] [string]$ListName, [Parameter(Mandatory=$true)] [string]$SourceView, [Parameter(Mandatory=$true)] [string]$TargetView ) 
  
  $site = Get-SPSite $SiteURL
  $web = $site.openweb()
  #Get the List
  $list=$web.lists[$ListName]
  #Get the source View
  $view = $list.Views[$SourceView]
  
  #Copy the source view
  if($view -ne $null)
  {
   #Get View Fields from an existing view
    $Viewfields = $list.Views[$SourceView].ViewFields.ToStringCollection()
    #Set View options
    $viewRowLimit="100"
    $viewPaged=$true
    $viewDefaultView=$false
    $viewQuery="<Where><Eq><FieldRef Name='Document_x0020_Type' /><Value Type='Choice'>Customer Reconciliation</Value></Eq></Where>"

    #Crete new view
    $newview = $list.Views.Add($TargetView, $viewFields, $viewQuery, $viewRowLimit, $viewPaged, $viewDefaultView)

   #Send message to output console
   write-host "View $($SourceView) Copied Successfully!" -foregroundcolor green 
  }
  else
  {
   write-host "Could Not find: $($SourceView)!" -foregroundcolor red 
  }
  
  $web.Dispose()          
  $site.Dispose()          
 }

Delete SharePoint List View in PowerShell: 
#Function to Delete View
 Function DeleteView()
 {  
  Param( [Parameter(Mandatory=$true)] [string]$SiteURL, [Parameter(Mandatory=$true)] [string]$ListName, [Parameter(Mandatory=$true)] [string]$ViewName ) 
  
  $site = Get-SPSite $SiteURL
  $web = $site.openweb()
  #Get the List
  $list=$web.lists[$ListName]
  #Get the View
  $view = $list.Views[$ViewName]
  
  #Delte the view
  if($view -ne $null)
  {
   $list.Views.Delete($view.ID)  
   #Send message to output console
   write-host "View $($ViewName) Deleted Successfully!" -foregroundcolor green 
  }
  else
  {
   write-host "Could Not find: $($ViewName)!" -foregroundcolor red 
  }
  
  $web.Dispose()          
  $site.Dispose()          
 }

Add New Field to Existing View:
#Function to Update Existing View
Function UpdateView()
 {  
  Param( [Parameter(Mandatory=$true)] [string]$SiteURL, [Parameter(Mandatory=$true)] [string]$ListName, [Parameter(Mandatory=$true)] [string]$FieldName) 
  
  #Get the site object
  $site = Get-SPSite $SiteURL
  #Get the Web object
  $web = $site.openweb()
  #Get the List
  $list=$web.lists[$ListName]
  
  #Process Each view
  0..($list.Views.Count-1) | foreach-object {
      #Get the view
      $view = $list.Views[$_]
      
      #Skip Hidden views and Explorer view
      if ( ($view.Title -ne "Explorer View") -and ($view.hidden -eq $false) )
      {
      
        #Delete if already exist
        #while($view.ViewFields.ToStringCollection().Contains($FieldName))
        #{
        #$view.ViewFields.delete($FieldName)
        #$view.Update()
        #}

        #Check if view has the specific field already!
        if(!$view.ViewFields.ToStringCollection().Contains($FieldName))
            {
                #Add new field to existing view
                $view.ViewFields.add($FieldName)
                $view.Update()
                write-host "Field Added to View: $($view.Title) in the list $($list.title)"
            }
       }
         
    }
   
  #Dispose the objects
  $web.Dispose()          
  $site.Dispose()      
 }

Added MOSS 2007 compatibility to support SharePoint 2007 environments
# For MOSS 2007 compatibility
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

#Region MOSS2007-CmdLets

Function global:Get-SPSite()
{
  Param( [Parameter(Mandatory=$true)] [string]$SiteCollURL )

   if($SiteCollURL -ne '')
    {
    return new-Object Microsoft.SharePoint.SPSite($SiteCollURL)
   }
}
 
Function global:Get-SPWeb()
{
 Param( [Parameter(Mandatory=$true)] [string]$SiteURL )
  $site = Get-SPSite($SiteURL)
        if($site -ne $null)
            {
               $web=$site.OpenWeb();
            }
    return $web
}
#EndRegion

Once tested above snippets, placed them inside my PowerShell script, called those functions wherever required.
$WebURL="https://sharepoint.crescent.com/sites/finance/"

 #Get the Target Site
 $Web=Get-SPWeb $WebURL

 foreach($List in $web.lists)
 {
  if ( ($List.BaseType -eq "DocumentLibrary") -and ($List.Hidden -eq $false) )
   {
   write-host "Processing List: $($list.title)"

    #Call funtion to create new view 
    CreateNewView $WebURL $List.title "Global Customers"

    #Call the Function to Delete view
    DeleteView $WebURL $List.title "Journal Vouchers"

    #Call function to Update existing view 
    UpdateViewFilter $WebURL $List.title "Vendor Reconciliation" "<Where><Eq><FieldRef Name='Document_x0020_Type' /><Value Type='Choice'>Vendor Reconciliation</Value></Eq></Where>"

    #Call function to copy existing view
    CopyView $WebURL $List.title "Vendor Reconciliation" "Customer Reconciliation"

   #Call the function to update view with Internal Name of the new field to be added
    UpdateView $WebURL $list.title "Management_x0020_System_x0020_Department" 
   }
 }

BTW, This is a PowerShell version of my existing work, where I did similar thing using .Net Object Model (C#).  How to Create Update Delete SharePoint Views Programmatically

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Nintex Workflow Tasks Item not found Error - Solution

Problem: Nintex Workflow tasks displays : * Item Not found error!
Nintex Workflow Tasks Item not found Error

Cause: Workflows are initiated and items in which workflows ran, are deleted by end-user. When I tried terminating the workflows, it gave "Server was unable to process the request --> Values does not fall within the expected range." error message! When I tried opening workflow task, got "Value does not fall within the expected range" Error!!

Solution: Use NWAdmin tool to terminate the tasks for deleted items. Here is how:
Go to command prompt,

CD "C:\Program Files (x86)\Nintex\Nintex Workflow 2007"

NWAdmin -o SyncTerminatedWorkflows -url https://sharepoint.company.com/finance/v3 -terminatedeleteditems
nintex terminate deleted item's workflow tasks

So, to avoid such issues, always terminate the workflow and then delete the items. Item not found may also occur when user doesn't has at least read access on the item!

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Monday, February 25, 2013

Nintex Workflow "There was an error installing the content type required for the flexi task action"

Nintex Workflow was giving an error, when trying to publish: "There was an error installing the content type required for the Flexi-Task action. Please arrange for an Administrator to run the following command on the server: stsadm.exe  -o installfeature -n nintexworkflowcontenttypeupgrade For more information please contact support@nintex.com"
There was an error installing the content type required for the flexi task action. Please arrange for an Administrator to run the following command on the server: stsadm.exe  -o installfeature -n nintexworkflowcontenttypeupgrade For more information please contact support@nintex.com
I already ran that command: stsadm –o installfeature –n nintexworkflowcontenttypeupgrade, as in the error screen. it completed with "Operation completed successfully!" but still had the same error!!

Then I tried activating it:
stsadm -o activatefeature -name nintexworkflowcontenttypeupgrade -url http://sharepoint.crescent.com/sites/finance/ -force

and things are turned good!

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Find the GUIDs of SharePoint Site Collection, Site, List, View and Columns

We may have to find the GUID of SharePoint objects such as web application, site collection, web, list, view or column at times. Here are some nifty techniques:

Get web application GUID in SharePoint 2010
Lets find web application GUID in SharePoint 2010. Go to Central Admin >> System Settings >> Click on "Configure Cross-firewall access zone" link under Farm Management and choose the desired web application and click Ok. Now, we get the web application GUID in address bar!
sharepoint 2010 get web application guid
Get Site Collection GUID from Central Administration:
In central administration, navigate to links such as "Change Site Owner" by going to: Central Admin >> Application Management >> Change Site collection Administrators and Pick the target site collection. Now, you'll get site collection ID in browser address bar, as highlighted. get sharepoint site guid powershell

Find List GUID from SharePoint User Interface:
Head on to List settings >> Hover over list settings links such as "Column Default Value Settings", watch the status bar, There is your ID! You can copy shortcut to get the GUID of the particular list!
how to get list guid in sharepoint 2010

How to get SharePoint list view GUID:
Go to "Modify View" page, a typical view would look like:
http://sharepoint.com/_layouts/ViewEdit.aspx?List=b6a291e8%2D708d%2D4ad1%2Dbaac%2D6262d37d8941&View=%7B11C32C0E%2D52BA%2D4F7F%2D93D6%2D91CDFA41485E%7D&Source=http%3A%2F%2Fsharepoint%2Ecom%2FDesign%2520Documents%2FForms%2FAllItems%2Easpx

From the above, we've a parameter "View" with value: %7B11C32C0E%2D52BA%2D4F7F%2D93D6%2D91CDFA41485E%7D , use the below decoding technique to get the GUID.

SharePoint GUID Conversion Encoding: just replace:
  • %7B with  {
  • %2D with  -
  • %7D with  }

Using SharePoint Manager tool to get GUID of any SharePoint object:
Just navigate to the target object, such as web application, site collection, site, column, view, etc. and pick the value at "ID" attribute.
get list guid in sharepoint 2010


Using PowerShell to find GUID of SharePoint Web Application/ Site Collection/Site/List/View/Column:
Now the PowerShell way! How to get list GUID in SharePoint 2010 using PowerShell? Lets use PowerShell to retrieve GUID of web application, Site collection, Site, List and column objects programmatically.
  
Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue

#get sharepoint web application guid
Write-Host "Web Application GUID:" (Get-SPWebApplication "http://sharepoint.crescent.com").id
 
#get sharepoint site guid powershell
Write-Host "Site Collection GUID:" (Get-SPSite "http://sharepoint.crescent.com").id 

#powershell to get web guid
Write-Host "Site/Web GUID" (Get-SPweb "http://sharepoint.crescent.com").id

#how to get list guid in sharepoint 2010 using powershell
$Web = Get-SPWeb "http://sharepoint.crescent.com/sites/operations/"
#Get the List
$List = $web.Lists["Design Documents"]
Write-Host "List GUID:" $List.id

#find sharepoint list view guid
Write-Host "View Guid:" $List.DefaultView.ID
#write-host $List.Views["All Documents"].ID;

#get guid of site column
$SiteColumn = $web.Fields["Department"]     
Write-host "Site column GUID:"$SiteColumn.id

#get sharepoint list column guid
$ListCol = $list.Fields["Category"]
Write-host "List column GUID:"$ListCol.id 


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Sunday, February 24, 2013

Search SharePoint Recycle bin with SPRecycleBinQuery

Searching inside SharePoint recycle bin for a deleted item or file, is a pain especially when you have LOT of deleted items and files in SharePoint recycle bin. Unfortunately SharePoint doesn't provide Search capability in recycle bin and you have to press Next>> <<Prev buttons to search for your file. 

We can perform Search on SharePoint Recycle bin items with SPRecycleBinQuery. Here is an example of SPRecycleBinQuery with PowerShell.

Good news is: If you know your file name, can search inside recycle in programmatically with PowerShell!

[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

#Get the Site collection
$site = new-object Microsoft.SharePoint.SPSite("http://sharepoint.company.com")

#Create new object for SPRecycleBinQuery
$query = new-object Microsoft.SharePoint.SPRecycleBinQuery

#$query.ItemState = "FirstStageRecycleBin"
$query.ItemState = "SecondStageRecycleBin"

#How many Rows to be returned
$query.RowLimit = 100

#Call GetRecycleBinItems to Search Inside SharePoint Recycle Bin
$DeletedItemsColl = $site.GetRecycleBinItems($query)

#Filter Result
$Result= $DeletedItemsColl | where  {$_.Title -match ".txt"}

#Write output
$Result | foreach-object {
    (Write-Host "Found Item:" $_.Title)
    (write-host "Created by:" $_.AuthorName)
    (write-host "Deleted by:" $_.DeletedByName)
    (write-host  "Deleted Date:"$_.DeletedDate)
  (write-host  "File Size(Bytes):" $_.Size)
  (write-host  "Original Location:" $_.DirName)
  (write-host "Web:" $_.web.URL)
 (Write-Host "------------------------------------")
  }
 
We can search recycle bin items based on File Name, Deleted By, Deleted Time, Size, etc. Its also possible to either restore or permanently delete the files by calling approximate method.This is extremely useful if you want to search recycle bin programmatically!

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Friday, February 22, 2013

Get All Files of Particular Type

In a Branding revamp project, After updating new logo on the SharePoint CSS Files, Found there are lot of InfoPath forms out there with old logo. So had to figure out all deployed InfoPath XSN Templates!

PowerShell Script to Find all XSN Files:
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null
 
#For SharePoint 2007
function global:Get-SPSite($url){
    return new-Object Microsoft.SharePoint.SPSite($url)
}

#Function to Scan XSN Files
Function GetXSNFiles($Folder)
{
    foreach ($File in $Folder.Files | Where-Object {$_.Name -match ".xsn"} )
    {
     #Write data to CSV File
     "$($Folder.ParentWeb.Site.RootWeb.Title)" +"`t"+ "$($Folder.ParentWeb.Title)" +"`t" + "$($Folder.ParentWeb.URL+"/")$($File.URL)" +"`t" + "$($File.TimeLastModified)" >> XSNTemplates.csv
    }

    #Iterate through all subfolders
    foreach ($SubFolder in $Folder.SubFolders)
    {
        #Call the function recursively
        GetXSNFiles $SubFolder
    }
}
 
#Write the CSV header
"Site Collection `t Site `t Form Template `t Last Modified" > XSNTemplates.csv

#Get the web application
#Write-Host "Enter the Web Application URL:"
$WebAppURL= "http://sharepoint.crescent.com"   #$WebAppURL= Read-Host
$SiteColletion = Get-SPSite($WebAppURL)
$WebApp = $SiteColletion.WebApplication
 
#Loop through all site collections of the web app
    foreach ($site in $WebApp.Sites)
    { 
       #Get the collection of webs
       foreach($web in $site.AllWebs)
        {
              write-host "scanning site" $web.title "@" $web.URL
              
              #Call the function to Get XSN Files
              GetXSNFiles($Web.RootFolder)
              
         #Dispose web object
         $web.dispose()
        }
 
        #Dispose site object
        $site.Dispose()
    }
Write-host  "Report Generated: XSNTemplates.csv" -foregroundcolor green

Script will search each and every list and library for specific file type and log that information to a Tab Separated text file.

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Wednesday, February 20, 2013

Find All Checked Out Files and Check-In them Back

I'm Sharing one of the PowerShell script I used in MOSS 2007 to SharePoint 2010 migration. Since its very difficult to check-in back all the checked-out files after migration, its a best practice to check-in all checked out files prior.

This PowerShell script will Scans, Generates Report and check-in all checked out files. Run this script with Farm Administrator privileges.
# For MOSS 2007 compatibility
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

#Region MOSS2007-CmdLets

Function Get-SPWebApplication()
{   
  Param( [Parameter(Mandatory=$true)] [string]$WebAppURL )
  return [Microsoft.SharePoint.Administration.SPWebApplication]::Lookup($WebAppURL)
}

Function global:Get-SPSite()
{
  Param( [Parameter(Mandatory=$true)] [string]$SiteCollURL )

   if($SiteCollURL -ne '')
    {
    return new-Object Microsoft.SharePoint.SPSite($SiteCollURL)
   }
}
 
Function global:Get-SPWeb()
{
 Param( [Parameter(Mandatory=$true)] [string]$SiteURL )
  $site = Get-SPSite($SiteURL)
        if($site -ne $null)
            {
               $web=$site.OpenWeb();
            }
    return $web
}
#EndRegion

 Function GetCheckedOutFiles()
 {  
    #Define 'Web Application URL' as Mandatory Parameter
    Param( [Parameter(Mandatory=$true)] [string]$WebAppURL )
 
 #Get the Web Application
    $WebApp=Get-SPWebApplication($WebAppURL)

    #Write the CSV Header - Tab Separated
 "Site Collection Name `t Site Name`t Library `t File Name `t File URL `t  Last Modified `t Checked-Out By" | out-file CheckedOutFiles.txt

 #Arry to Skip System Lists and Libraries
 $SystemLists =@("Converted Forms", "Master Page Gallery", "Customized Reports", "Form Templates",  
                 "List Template Gallery", "Theme Gallery", "Reporting Templates",  "Solution Gallery",
           "Style Library", "Web Part Gallery","Site Assets", "wfpub")
 
   #Loop through each site collection
  foreach($Site in $WebApp.Sites)
   {
    #Loop through each site in the site collection
     foreach($Web in $Site.AllWebs)
   {
            #Loop through each document library
            foreach ($List in $Web.GetListsOfType([Microsoft.SharePoint.SPBaseType]::DocumentLibrary))
            {
                #Get only Document Libraries & Exclude Hidden System libraries
                if ( ($List.Hidden -eq $false) -and ($SystemLists -notcontains $List.Title) )
                {
     #Loop through eadh Item
      foreach ($ListItem in $List.Items) 
      {
                  if( ($ListItem.File.CheckOutStatus -ne "None") -and ($ListItem.File.CheckedOutByUser -ne $null))
      {
                        #Log the data to a CSV file where versioning size > 0MB!
                        "$($Site.RootWeb.Title) `t $($Web.Title) `t $($List.Title) `t $($ListItem.Name) `t $($Web.Url)/$($ListItem.Url) `t  $($ListItem['Modified'].ToString()) `t  $($ListItem.File.CheckedOutByUser)" | Out-File CheckedOutFiles.txt -Append
      
       #*** Uncomment the below line to Check-in****#
       $ListItem.File.Checkin("Checked in by Administrator")
      }
                    }
                }
            }
   $Web.Dispose()          
        }
 $Site.Dispose()          
    }
 
    #Send message to output console
    write-host "Checked out Files Report Generated Successfully!"
}

#Call the Function to Get Checked-Out Files
GetCheckedOutFiles "http://sharepoint.company.com"

Find all Checked-Out files from a SharePoint Library using PowerShell:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
 
#Variables
$WebURL="http://sharepoint.crescent.com"
$LibraryName="Shared Documents"

#Get Objects
$Web = Get-SPWeb $WebURL
$Folder = $web.GetFolder($LibraryName)

#Function to find all checked out files in a SharePoint library
Function Get-CheckedOutFiles($Folder)
{

    $Folder.Files | Where { $_.CheckOutStatus -ne "None" }  | ForEach-Object {
    write-host ($_.Name,$_.URL,$_.CheckedOutBy)

    #To Check in
    #$_.Checkin("Checked in by Administrator")
    }

   #Process all sub folders
   $Folder.SubFolders | ForEach-Object {
   Get-CheckedOutFiles $_
   }
}

#Call the function to find checkedout files
Get-CheckedOutFiles $Folder 

Its also possible to retrieve all checked out files via Search! Here is how: Create a Managed Property by adding the existing crawled property: ows_CheckoutUser(Text), then you can use that managed property in your search!
Bulk Check-In all checked-out files in Site collection:
If you want to check-in all checked-out files by you, use "Content and Structure" link under site settings. (/_Layouts/sitemanager.aspx)
Bulk Check-in Files in SharePoint
You have the option "Checked Out to Me" which lists all files checked-out to you. Just select the desired files and click Check-in from actions menu.

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Monday, February 18, 2013

Redirect Old MOSS 2007 Site to New SharePoint 2010 Site during Migration using URL Rewrite

In a database attachment method of migration from MOSS 2007 to SharePoint 2010, we gradually moved site collections one by one by attaching content databases of individual site collections. It took a while to address migration fixes and make them in a good shape for each site collection.

Meanwhile, had to redirect Users to migrated SharePoint 2010 site collections when they hit old MOSS 2007 site collection URLs or access them from bookmarks. Ideally, once migration is completed, we must place a server redirect in publishing server (like F5/ISA) or DNS change to send users from old URL to new URL.

But in our case, As we move site collections one by one, only few site collections needs to be redirected.

Solution: IIS URL Rewrite Module! Lets create a URL Rewrite Rule to redirect from old MOSS 2007 site collection to migrated SharePoint 2010 site. Say our:
  • Source: "http://moss2007.company.com/sites/marketing" 
  • Target: "http://sharepoint2010.company.com/sites/marketing".
Implementation:
Step 1: To start with, download and install URL Rewrite Module in Web Front End(WFE) Server(s) from: http://www.iis.net/download/urlrewrite
sharepoint 2010 URL rewrite redirect

Step 2: Once installed, Go to IIS Manager >> Select your Source SharePoint web site (moss2007.company.com) >> In Right pane, open "URL Rewrite" Module
redirect sharepoint site iis

Step 3: Create new inbound rule by clicking Add Rule(s) >> "Blank rule" >> Give it a Name, say: "Redirect Marketing Site collection".
sharepoint redirect to site collection

Step 4: Under Match URL section, specify values as:
  • Request URL: Matches the Pattern 
  • Using: Regular Expression 
  • Pattern: (.*)
  • Select Ignore case check box
sharepoint redirect site

Step 5: Under conditions section, specify values as:
Logical grouping:
Match All
Click on Add button and enter:

  •         Condition input: {URL}
  •         Check if input string: Matches the Pattern
  •         Pattern: /sites/marketing(/.*)
  •         Select "Ignore case" check box
sharepoint redirect entire site

Step 6: In "Action" section, Enter the values as:
  • Action Type: Redirect
  • Redirect URL: Enter the target URL E.g. Http://sharepoint2010.company.com/sites/marketing"
  • Select "Append Query String" check box
  • Redirect Type: Permanent(301)
sharepoint redirect a site

Step 7: Save the rule by clicking "Apply" link from Right action Pane!

That's all! Moving forward, when users hit "http://moss2007.company.com/sites/marketing" , they'll be redirected to "http://sharepoint2010.company.com/sites/marketing".
Its also possible to place a Page level redirect using Content Editor Web Part. Refer: Page Redirect Using CEWP JavaScript in SharePoint


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Thursday, February 14, 2013

Hide Links in Site Settings Page with HideCustomAction

Problem: People makes SharePoint branding inconsistent by creating and applying random themes and breaks corporate branding. So need to stop users from creating & uploading new themes and applying them.

Solution:
Hide Themes and Site Themes links with "HideCustomAction" from Site Settings!
Some time back, I created a feature to Hide "Delete this site" link from Site settings. Lets re-use the same trick to build a feature to hide "Themes" link from site settings page from everyone. Lets gets started.

1. Create New "Empty SharePoint Project" in Visual Studio 2010. Give it a name. Say: Crescent.TeamSite.HideThemes. Make it a Farm Solution.

2. Add a Feature to the project by right clicking "Features" node in the Solution Explorer, Add Feature

3. Add new Module to the Project, by Right clicking the project Crescent.TeamSite.HideThemes from solution explorer and choose "Add >> New Item", Give it a name. Say: HideThemes

Now the project structure should look like:

4. Update the Elements.xml file inside module we created:
 <HideCustomAction 
  GroupId = "Customization"
  HideActionId = "Theme"
  Location = "Microsoft.SharePoint.SiteSettings"> 
  </HideCustomAction>
  
  <HideCustomAction
GroupId = "Galleries"
HideActionId = "Themes"
Location = "Microsoft.SharePoint.SiteSettings">
  </HideCustomAction>

Element.xml file should look like:

5. Go to the Feature Designer: Right Click "HideThemes" under Features node, choose "View Designer"

6. Provide name to the feature, as: "Hide Themes in Site Settings", set the scope as Site and include the Module we created "Hide Themes Module"

7. Build and deploy the Project

8. Activate the Feature: Go to Site actions >> Site Settings >> Site Collection Features >> Click on Activate next to "Hide Themes in Site Settings"


and the Result: See that the "Themes" link is hidden under Galleries!
 
Finally, We made the feature hidden, Activated for required site collections and we are done!

Refer MSDN to get Default Custom Action Locations and IDs

Additional Tip: Use IE Developer Toolbox or Firefox FireBug to Get the GroupID and HideActionID values.
get customactionid using IE Developer toolbar, Firebug

Disable Themes for All Sites in a Web Application
To stop users from applying themes at web application level, We can simply disable the web application user permissions "Apply Themes and Borders  -  Apply a theme or borders to the entire Web site." by going to: Central Administration >> Application Management >>Manage Web Applications >> Select the desired web app >> Click on "User Permissions" from Ribbon
web application user permissions

However, this will disable all users including farm administrator from applying themes and give error message "Attempted to perform an unauthorized operation." when they try to apply themes. There is a another way to disable themes by editing "SPTHEME.XML" file from 14 hive, which is not recommended!

But the actual requirement is to not to disable themes in all site collection of the web application. Now the question is: How to stop users from accessing "Themes" and "Site Themes" links on particular site collection(s)? So we made the feature, and activated wherever required.

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Tuesday, February 12, 2013

Creating SharePoint Search Scope to Find Only Documents

Requirement: End-User wants to get only documents in search results!

Solution: In brief, create a new search scope of "ContentClass" Type "STS_ListItem_DocumentLibrary". This will filter search results with in all the documents under SharePoint document libraries.

At high level, to get filter search results by only documents, We are going to:
  1. Create a New Search Scope
  2. Add Rules to Search Scope
  3. Create New Page for Search Results
  4. Set Search Core Results Web Part Scope Property
  5. Add New Tab to Search Center, Link the Search Page crated
I assume SharePoint search service application is already in place, up and running. (if not, create it first!)

Step 1: Create a New Search Scope:

Go to Central Administration >> Manage service applications >> Search Service Application (or whatever SSA created in your environment) >> Manage >> Click on "Scopes" Link in Search Administration.
Click on New Scope to Create a New Scope.
Give a Name to the scope. Say: "Search All Documents". Click "OK" to create the scope.
sharepoint document search

Step 2: Add Rules to Search Scope

Add Rules to our created scope by clicking "Add rules" link next to newly created scope.sharepoint search only document libraries
  • Choose "Property Query" in Scope Rule Type. 
  • Select "contentclass" in Property Query, enter "STS_ListItem_DocumentLibrary" as property value. 
  • Choose "Include..." under behavior.
sharepoint 2010 documents search scope
On clicking "Ok" button, You will see SharePoint saying "Scope will be updated in 14 Minutes". Fortunately, no need to wait so. Go back to Search Administration >> Click on "Start Update Now" link next to Scope Needing Update
sharepoint search multiple document libraries
Once scope updated, you can verify the scope results by checking our newly created scope.
sharepoint search scope for document library
Alright, we have the scope ready. Lets move forward to make it available to user from search center.

Step 3:Create New Page for Search Results

Go to Search Center site, Create a New Page (Don't have Search Center created? Then create a New page in your team site of "Search Results" Page Layout type).
sharepoint search for all document library
Give it a Name. say: SearchAllDocuments.aspx

Step 4: Set Search Core Results Web Part Scope Property

Edit SearchAllDocuments.aspx page, Edit "Search Core Results" web part.
Expand the web part properties, under Location Properties >> Enter the scope as: Search All Documents (which is the name of the scope we have created in step: 1). Click "Ok" to save the changes. Publish/Check-in the page.

 Step 5: Add New Tab to Search Center, Link the Search Page crated

Go to the Search Center site >> Get the Ribbon from Site actions >> Click on "Edit" button from the ribbon

Click on "Add New Tab"
Give name to the tab, say: Search All Documents, Enter "SearchAllDocuments.aspx" (or whatever page we created in Step 3) for page field.
That's all! Search for a keyword to see our work in action!!
sharepoint search documents only

As SharePoint 2010 supports search refinements, we can refine the results further by clicking appropriate links (e.g. "Word" under result type search refinements web part).

Using the same method, We can filter search results based on other properties supported. For all available ContentClass parameters, refer http://msdn.microsoft.com/en-gb/library/dd584327%28office.11%29.aspx
E..g. You want to get all task list items. or you may want to search only surveys or picture libraries, etc.

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Monday, February 11, 2013

SharePoint 2013 Correlation ID - Get Detailed Error using PowerShell

Correlation IDs are introduced in SharePoint 2010 to uniquely identify each error encountered. Later, these correlation ids are used as a starting point reference to get the complete error details from ULS logs during troubleshooting issues.

How to check correlation id in SharePoint 2013?
While its possible to open and search ULS logs correlation ids with notepad, There are some easy ways and tools to lookup correlation id errors in SharePoint 2013.

Here is a typical SharePoint 2013 sorry something went wrong" error page with correlation id.
sharepoint 2013 sorry something went wrong correlation id

Find SharePoint 2013 correlation id using PowerShell
Just get the correlation id SharePoint 2013 from the error page and pass it to the PowerShell cmdlet: Get-SPLogEvent. Here are some examples: Login to your SharePoint server(s), Open SharePoint 2013 management shell and replace the GUID with your correlation ID.
#Get all details of the error
Get-SPLogEvent | ?{$_.Correlation -eq "6922c76b-32f7-4e2e-af96-fbda88a77fa5"}

#Retrieve selective columns of the error 
Get-SPLogEvent | ?{$_.Correlation -eq "f53b559c-f70e-002f-694c-7d3b8b55f534"} | select Area, Category, Level, EventID, Message | Format-List

#Get sharepoint 2013 correlation id in error messages and send to file
Get-SPLogEvent | ? {$_Correlation -eq "3410f29b-b756-002f-694c-7a574ff74cab" } | select Area, Category, Level, EventID, Message | Format-List > C:\SPError.log

#Get all issues logged in the past 10 minutes
Get-SPLogEvent -starttime (Get-Date).AddMinutes(-10)

#Get Events between specific time frames
Get-SPLogEvent -StartTime "03/06/2015 18:00" -EndTime "03/06/2015 18:30" 

Find and Extract ULS LOG in Multi-Server SharePoint Farm:
Please note, All these cmdlets search for given correlation ID on specific SharePoint server where you run the PowerShell script. To search and extract LOG from all SharePoint Servers, matching the given correlation ID, use:
Merge-SPLogFile -path "D:\ErrorLog.txt" -Correlation "Your-error-correlation-id"

SharePoint 2013 correlation id viewer
There are some good tools out there.
SharePoint 2013 correlation id location:
Usually, ULS logs are located at 14/15 hive's LOGs folder. E.g: "C:\Program Files\Common files\Microsoft Shared\Web Server Extensions\15\LOGS"

SharePoint 2013 correlation id not in log?
ULS logs are specific to per WFE (Web Front End) server. So, In a multi-Server SharePoint farm, When users hit SharePoint 2013 sites and ended up in error page, that can be served by any one of the front end, with the error logged in the ULS logs folder of the particular web front end.

So, if SharePoint 2010 correlation id not in log, you got query all web front end's ULS logs with the specific correlation ID. Use the below method of querying SQL Server to get the error details regardless of the server.

Query SQL Server Database for a specific correlation ID:
In SharePoint 2013 search correlation id error can also be done by querying the Logging database. Its usually with name: WSS_Logging unless you change it! Query from ULSTraceLog view as:
SELECT [MachineName], 
    [Area],
    [Category],
    [Level],
    [EventId],
    [Message],
    [CorrelationId] 
FROM ULSTraceLog 
WHERE [CorrelationId] = '39C29F9C-6890-D07A-0D7C-5A3A7AB7BFF5'


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Sunday, February 10, 2013

How to Hide Home Tab in SharePoint 2007-2010-2013 Top Navigation

Ever wanted to Hide or Remove the Home Tab (or First Tab) from SharePoint Site's Top navigation Menu bar?
sharepoint hide home tab
How to Hide home tab in SharePoint 2010
How to do that? Site Settings >>  Navigation Settings? No! You won't get an option to remove Home tab (or First Tab) from Navigation there!

Solution:
We can Hide SharePoint site's Home tab by overriding CSS classes of the the Top Navigation:

CSS to Hide Home Tab in SharePoint 2010:
<style type="text/css"> 
.s4-tn li.static > a
{
   display: none !important; /* hide home button sharepoint 2010 */
}
.s4-tn li.static > ul a
{
   display: block !important;
}
</style>

Place these styles in your Style Sheet preferably(CSS), / Master Page / Content Editor web part based on your requirement! and the result goes here: home tab hidden in SharePoint 2010 site.
how to hide home tab in sharepoint 2010
SharePoint 2007 hide home tab: 
Just grabbed the ID of Home tab with IE developer toolbar, and the CSS code to Hide Home tab in SharePoint 2007:

<style type="text/css"> 
#zz1_TopNavigationMenun0 {

display: none !important;

}
</style>

Remove home link in SharePoint 2013 Menu with CSS:
<style type="text/css">
/* sharepoint 2013 hide home link top navigation * / 
A[accesskey="1"] { display: none !important; }
</style>

Hide Home Tab in SharePoint 2013 Top Navigation using jQuery:
 <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>

<script type="text/javascript">

        $(document).ready(function () {

            $("a:contains('Home')").parent('li').hide();


        });</script>


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Wednesday, February 6, 2013

Export Import Quota Templates in SharePoint with PowerShell

In SharePoint database attach method migration, Quota templates must be created manually between farms. Its a pain when you have multiple quotas defined. These PowerShell scripts simplifies the process by exporting quotas to a XML file and import it again to another farm.

PowerShell Script to Export/Import Quotas between environments:
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
[Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration") 

function Export-QuotaTemplates([string]$FileName)
{
 #Get the SharePoint Web Application Service
 $ContentService =[Microsoft.SharePoint.Administration.SPWebService]::ContentService

 #Define Quota Templates XML -Container wrap
 $QuotaTemplateXML = '<QuotaTemplates>'
 #Get all Quota Templates
 foreach ($QuotaTemplate in $contentService.QuotaTemplates)
 {
    #Add Quota Templates to XML
    $QuotaTemplateXML += '<QuotaTemplate>'
    $QuotaTemplateXML += '<ID>'+ $QuotaTemplate.QuotaID +'</ID>'
    $QuotaTemplateXML += '<Name>'+ $QuotaTemplate.Name +'</Name>'
    $QuotaTemplateXML += '<StorageMaximumLevel>'+ [int](($QuotaTemplate.StorageMaximumLevel/ 1024)/1024) +'</StorageMaximumLevel>'
    $QuotaTemplateXML += '<StorageWarningLevel>'+ [int](($QuotaTemplate.StorageWarningLevel/ 1024)/1024) +'</StorageWarningLevel>'
    <# These two Properties applicable only for SharePoint 2010 and above!
    $QuotaTemplateXML += '<UserCodeMaximumLevel>'+ $QuotaTemplate.UserCodeMaximumLevel +'</UserCodeMaximumLevel>'
    $QuotaTemplateXML += '<UserCodeWarningLevel>'+ $QuotaTemplate.UserCodeWarningLevel +'</UserCodeWarningLevel>'
    #>
    $QuotaTemplateXML += '</QuotaTemplate>'
 }
 #Wrap Into the closing element
 $QuotaTemplateXML += '</QuotaTemplates>'
 $QuotaTemplateXML| Out-File $FileName
 Write-Host "Exported Quota Templates!"
}

 #Call Import Quota Templates Function
 Export-QuotaTemplates "QuotaTemplates.xml"

Once Exported, We can copy the exported xml file to target environment and run the Import script.

PowerShell Script to Import Quota Templates:
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
[Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration") 

function Import-QuotaTemplates([string]$FileName)
{
   #Get the XML File Contents
   [xml]$QuotaTemplateXML = Get-Content $FileName

   $ContentService =[Microsoft.SharePoint.Administration.SPWebService]::ContentService
   #Get existing Quotas collection
   $QuotaTemplateColl = $ContentService.QuotaTemplates

   #Iterate throught each Quota Template
 foreach($QuotaTemplate in $QuotaTemplateXML.QuotaTemplates.QuotaTemplate)
 {
   Write-Host "Processing:" $QuotaTemplate.Name
  #Check if Quota Template already exists!
  if ($QuotaTemplateColl[$QuotaTemplate.Name] -ne $null) 
  {
   Write-Host " >> Quota template: " $QuotaTemplate.Name " Already exists!"
  }
  else #Create the Quota Template
  {
    $NewQuotaTemplate = new-object Microsoft.SharePoint.Administration.SPQuotaTemplate
   $NewQuotaTemplate.Name = $QuotaTemplate.Name
   $NewQuotaTemplate.StorageMaximumLevel = $QuotaTemplate.StorageMaximumLevel
   $NewQuotaTemplate.StorageWarningLevel = $QuotaTemplate.StorageWarningLevel
      <# These two Properties applicable only for SharePoint 2010 and above!
      $NewQuotaTemplate.UserCodeMaximumLevel = $QuotaTemplate.UserCodeMaximumLevel 
      $NewQuotaTemplate.UserCodeWarningLevel =  $QuotaTemplate.UserCodeWarningLevel
      #>
   $QuotaTemplateColl.Add($NewQuotaTemplate)

   Write-Host "    >> Quota template ", $NewQuotaTemplate.Name ," is imported to the Quota Templates"
  }
 }
 }

 #Call Import Quota Templates Function
 Import-QuotaTemplates "QuotaTemplates.xml"


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Tuesday, February 5, 2013

Navigation Link Missing in SharePoint Site Settings

Created a site collection for "Marketing" team today and they came with a complaint: "I couldn't see Navigation link under site settings! As 'Navigation' component  gives more options, we need it badly! How do we get it?".

Ok, I went to: Site Actions  >> Site Settings >> Look and Feel >> Nope! couldn't see Navigation link. Yes, Navigation link is missing!! instead I see "Quick Launch" and "Top Link Bar" links.
navigation link missing sharepoint 2010

Users must have the Full Control or Design permissions on the site to get Navigation link BTW.

Cause:
The navigation link missing SharePoint 2010 because the site template is based on "Team Site" template. Navigation Link will be available on sites based on Publishing Site/Collaboration site templates or Navigation link appears on site collections with publishing feature enabled. (If not you'd see "Quick Links.")

Solution:
Activate "SharePoint Server Publishing Infrastructure" feature! Go to:
  • Site Actions >> Site Settings
  • Under "Site collection administration" section click on "site collection features"
  • Activate the "Office SharePoint Server Publishing Infrastructure" feature
  • Now for each site you can activate feature "Office SharePoint Server Publishing"
  • Done! You should be able to see the option "Navigation" under look and feel.
navigation link missing sharepoint

You can do it only if you are a site collection administrator.

Alright, Don't want to activate publishing feature but want to access Navigation component? Sure, the simple workaround for this issue: Just append /_layouts/AreaNavigationSettings.aspx to the URL. E.g. http://sharepoint.crescent.com/teams/marketing/_layouts/AreaNavigationSettings.aspx
look feel navigation link missing sharepoint 2010
Don't want to activate publishing feature but need "Navigation" link under site settings? No issues. Here is the trick to get Navigation link in site settings: Navigation is actually a hidden feature which gets activated when you activate "Publishing Feature". So, we can just activate the "Navigation" feature directly. This will fix navigation link missing for SharePoint 2007.

stsadm -o activatefeature -name "navigation" -url "http://sharepoint.crescent.com/sites/sales" -force

For SharePoint 2010, you can enable the feature with PowerShell and get navigation link:
Enable-SPFeature -Identity "navigation" -url "http://sharepoint.crescent.com/teams/marketing/"


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Monday, February 4, 2013

SharePoint 2010 Top Navigation Drop Down Menu, Quick Launch Flyout

By default, SharePoint enables top navigation Fly out Menus when Publishing Feature is enabled. Other Site templates like Team Sites doesn't come up with top navigation flyout menus. However we can enable top navigation flyout menus by adjusting few parameters in master page.

Open the Master page in SharePoint designer, set "StaticDisplayLevels" to 1,  "MaximumDynamicDisplayLevels" to 3, accordingly either in design view or in code view. Save and publish the master page.
sharepoint 2010 navigation flyout menu

This is also applicable, when we use custom site map providers for Top navigation! Here is an example of SharePoint 2010 top navigation drop down menu.


sharepoint 2010 top navigation drop down menu
Flyout Quick Launch Menu
Same trick works on SharePoint quick launch navigation as well to bring flyout menus. Adjust the "StaticDisplayLevels" and "MaximumDynamicDisplayLevels" values based on the navigation depth accordingly. (say: 1)

And the output goes like this:
Before:
sharepoint 2010 quick launch flyout menu
After the change, SharePoint 2010 quick launch flyout menu appears as:sharepoint flyout quick launch

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


You might also like:

Related Posts Plugin for WordPress, Blogger...