Archive for December, 2010

This PowerShell Script will flush the cache for all web applications.
1
2
3
4
5
6
7
8
9
10
11
12
13
Write-Host -ForegroundColor White " - Enabling SP PowerShell cmdlets..."
If ((Get-PsSnapin |?{$_.Name -eq "Microsoft.SharePoint.PowerShell"})-eq $null)
{
$PSSnapin = Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | Out-Null
}
$webAppall = Get-SPWebApplication
foreach ($_.URL in $webAppall) {
$webApp = Get-SPWebApplication $_.URL
[Microsoft.SharePoint.Publishing.PublishingCache]::FlushBlobCache($webApp)
Write-Host "Flushed the BLOB cache for:" $webApp
}
Write-Host -ForegroundColor White " - Enabling SP PowerShell cmdlets..."If ((Get-PsSnapin |?{$_.Name -eq "Microsoft.SharePoint.PowerShell"})-eq $null){   $PSSnapin = Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | Out-Null}
$webAppall = Get-SPWebApplicationforeach ($_.URL in $webAppall) {$webApp = Get-SPWebApplication $_.URL[Microsoft.SharePoint.Publishing.PublishingCache]::FlushBlobCache($webApp)Write-Host "Flushed the BLOB cache for:" $webApp}

The other day, I was asked to debug the “Tagged Items” web part within SharePoint 2010. You can see this web part in action when clicking on a tag, in someones profile page. The link then takes you to tagprofile.aspx page, and shows you(by default) 60 days worth of tagging of the specfied tag / keyword.

The problem was PDF icons didn’t didn’t seem to work correctly. The first thing that came to mind was the DocIcon.xml, which I knew by default doesn’t have any entry’s for PDF Documents. So I went ahead and added this line to the DocIcon.xml :  <Mapping Key=”pdf” Value=”pdficon.gif”/>

Then I reset IIS and as expected in document library’s, I now showed a PDF Icon instead of the blank / default icon. However when I clicked the tag it still showed the red x next to the document title. I thought for a second, and then remembered that when SharePoint needs the larger icon, for a specified extension, it will append ”lg_” to whatever is listed in the DocIcon.xml. In my example this file name would be “lg_pdficon.gif”. Since I did not place the larger size icon file in the /images folder, this icon would not render. One I did, it rendered correctly.

The moral of the story is make sure you name your PDF file with a standard name ex: “pdficon.gif” this way SharePoint will be easily be able to reference the large icon by “lg_pdficon.gif” . The main reason for calling out the standized naming convention is because many of the PDF document walk thoughs on the internet use pdficon_small.gif as the name. Which when you add “lg_pdficon_small.gif ” seems a bit weird to me…

Notes**

The small icon should be 16×16 and the large should be 32×32.

Adobe Linking site. ( all the PDF icons you will every need… ) : http://www.adobe.com/misc/linking.html

More information about DocIcon.xml : http://msdn.microsoft.com/en-us/library/ms463701.aspx

Let me know if you have any troubles. Thanks!!

If you are trying to run this command in powershell : New-SPConfigurationDatabase  

You might encounter an error similar to the below… If you’re like me, you install all the necessary software for your farm first, then run the products and technology wizard / configure the farm. If you use the GUI, I have never encountered errors, however via PowerShell i did receive the errors below. As soon as i uninstalled the “Office Web Apps” the error went away. Thanks! Let me know if you have any questions. 

New-SPConfigurationDatabase : The pipeline has been stopped. 

At C:Usersadministrator.GENDesktopAutoSPInstallerSP2010AutoSPInstallerAutoSPInstaller.ps1:576 char:31 

+             New-SPConfigurationDatabase <<<<  –DatabaseName “$ConfigDB” –DatabaseServer “$DBServer” –AdministrationContentDatabaseName “$CentralAdminContentDB” –Passphrase $SecPhrase –FarmCredentials $Cred_Farm 

    + CategoryInfo          : InvalidData: (Microsoft.Share…urationDatabase:SPCmdletNewSPConfigurationDatabase) [New-SPConfigurationDatabase], PipelineStoppedException 

    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSPConfigurationDatabase 

Microsoft.SharePoint.SPException: This SharePoint farm currently has pending upgrades.  The cmdlet New-SPConfigurationDatabase cannot be executed until the upgrade is completed. 

   at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord) 

This SharePoint farm currently has pending upgrades.  The cmdlet New-SPConfigurationDatabase cannot be executed until the upgrade is completed. 

At C:Usersadministrator.GENDesktopAutoSPInstallerSP2010AutoSPInstallerAutoSPInstaller.ps1:576 char:31 

+                                             New-SPConfigurationDatabase <<<<  –DatabaseName “$ConfigDB” –DatabaseServer “$DBServer” –AdministrationContentDatabaseName “$CentralAdminContentDB” –Passphrase $SecPhrase –FarmCredentials $Cred_Farm 

    + CategoryInfo          : InvalidOperation: (:) [New-SPConfigurationDatabase], SPException 

    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSPConfigurationDatabase 

  • Archives

  • Tags

  • Subscribe
  • Pages

  • More

  • Disclaimer…

    This is my personal weblog. The opinions expressed herein are my own and are not representative of any 3rd party influence. The owner of this blog reserves the right to edit or delete any comments submitted to this blog without notice if they are deemed to be spam, offensive or otherwise inappropriate. The owner of this blog makes no representations as to the accuracy or completeness of any information on this site or found by following any link on this site. The owner will not be liable for any errors or omissions in this information nor for the availability of this information. The owner will not be liable for any losses, injuries, or damages from the display or use of this information.


    Lastly, I do my best to document my sources if the article is not of my own creation. If I have missed or forgotten to source your work. I would love feedback via the comments section. Thank you.

DreamHost promos
SiteLock