Thursday, September 13, 2012

Display Icon for Adobe PDF documents

We can see icons for the Ms Word, Excel, and PowerPoint but not for the PDF document in SharePoint.
Because this is an adobe product and not Microsoft. But yes we can easily show the icon for the PDF file.

Here given SC 13 No ID Record i have uploaded .pdf file but that not shows Icon.

  1.  First download a PDF icon on size. You can choose your own icon or can take it from here: 
     2.   Copy the image file that you want to use for the icon to the following folder on the server 

SharePoint Server 2010 - Drive: \Program Files\Common Files\Microsoft Shared\Web server extensions\14\Template\Images

     3. Now go to following Path.

SharePoint Server 2010- Drive: \Program Files\Common Files\Microsoft Shared\Web server extensions\14\Template\Xml\DOCICON.XML

Edit this file 


   4. Now do an IISReset. Now Output will be as follow,


PowerShell script to take Backup

SharePoint administrators need to run regular backups using PowerShell, the STSADM tool or in Central Administration.

Script :


Add-PsSnapin Microsoft.SharePoint.Powershell –ErrorAction SilentlyContinue
try
 {
    $today = (Get-Date -Format dd-MM-yyyy)
    $backupDirectory = "C:\Backup\DailyBackUp\$today"
  # Backup file Location
    $backupFile = "C:\Backup\DailyBackUp\$today\Backup.dat"
  # Log file location
    $logFile = "$backupDirectory\BackupLog.log"   
  # Address of the Site Collection to backup
    $Site = "http://Spserver1:2000"
   
 # Location of the Backup Folder
    if (-not (Test-Path $backupDirectory))
    {
      [IO.Directory]::CreateDirectory($backupDirectory)
      #New-Item $logPath -type $backupDirectory
    }
  
 # Get backup start date and time
    $backupStart = Get-Date -format "MM-dd-yyyy HH.mm.ss"
   
  # creates a log file  Start-Transcript -Path
    Start-Transcript -Path $logFile
     
 # This will actually initiate the backup process.
      Write-Host   
      Write-Host   
      Write-Host "Backup starting at $backupStart for $Site "   
      Write-Host "******************************************"
     Backup-SPSite -Identity $Site -Path $backupFile -Force
     $backupComplete = Get-Date -format "MM-dd-yyyy HH.mm.ss"
      Write-Host   
      Write-Host   
      Write-Host "Backup Completed at $backupComplete for $Site "   
      Write-Host "******************************************"
  
 Stop-Transcript
 }
Catch
 {
  $ErrorMessage = $_.Exception.Message
  write "$today BackUp Failed   $ErrorMessage  ">>$logFile
 
 }