TwitterLinkedInBlog

Monday, February 23, 2015

PowerShell - Delete Duplicate Quick Launch Nodes

Scenario:
  • Site slow to load, resulting in an exception with a correlation ID
  • ULS log error: PortalSiteMapProvider was unable to fetch children for node at URL
  • Temporarily hide the quick launch so users can navigate to the site: SharePoint Designer 2010 > http://samplesite > Left Nav > 'Sample Site Name' > uncheck 'Display Quick Launch' > Save.
  • Find the offending Quick Launch node by running the following SQL query against the content database. You should see many, many repeating entries: SELECT * FROM NavNodes
  • Delete the repeats from the Quick Launch via PowerShell:
    $FindString = “Offending Sample Title”
    $web = get-spweb ("http://samplesite/")
    for ($i = $web.Navigation.QuickLaunch.Count-1; $i -ge 0; $i--)
    {
    write-host $web.Navigation.QuickLaunch[$i].Title "heading deleting...... "
    $web.Navigation.QuickLaunch[$i].Delete()
    write-host "heading deleted successfully !!!."
    }
  • Display the quick launch again.

Resources:

Tuesday, January 27, 2015

PowerShell - No Ellipses

No Ellipses:

| Format-Table -AutoSize

Tuesday, January 13, 2015

Excel 2013 - Freeze Top Row and First Column

Click B2 > Ribbon > View tab > Freeze Panes

Tuesday, January 6, 2015

PowerShell - SharePoint Database Size Report

$SMTPServer = "" 
$emailFrom = "" 
$emailTo = "" 
$subject = "Sharepoint DB Size Report"

$total = ""
$each = Get-SPDatabase | Sort-Object disksizerequired -desc | ForEach-Object {$db=0} {$db +=$_.disksizerequired; $_.name + " - " + ("{0:n0}" -f ($_.disksizerequired/1024/1024)) + "`t"} {$total = "`nTotal Storage (in MB) =" + ("{0:n0}" -f ($db/1024/1024))}
$each = Out-String -InputObject $each
$total = Out-String -InputObject $total

$emailBody = "SharePoint DB - Size in MB" + "`n" + "`n" + $each + $total

Send-MailMessage -SmtpServer $SMTPServer -From $emailFrom -To $emailTo -Subject $subject -Body $emailBody


Resources:
http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=193

Tuesday, December 9, 2014

Excel Services: Configure a workbook to use the unattended service account


'Data' tab > 'Connections' > data connection > 'Properties' > 'Definition' tab > 'Authentication Settings' button > 'None' radio button > OK > OK > Close.
 
With the Excel Services Authentication Settings set to None, Excel Services uses the unattended service account to refresh the data in the workbook after you have published it to SharePoint Server 2013.

Resources:
http://technet.microsoft.com/en-us/library/hh525344%28v=office.15%29.aspx

Monday, November 24, 2014

Application Pools Not Starting After Reboot

IIS Manager > Computer Name > Configuration Editor > Section dropdown > system.applicationhost > application pools > (Collection) > eclipses (…) > select application pool > startMode > AlwaysRunning.

Source:
http://msdn.microsoft.com/en-us/library/ee677285%28v=azure.10%29.aspx