Posts

Showing posts from November, 2014

How to flush the BLOB cache using powershell script

In this blog post I'm going to show you how to flush the BLOB cache using powershell script. Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue $webApp = Get-SPWebApplication "http://webapplicationurl/" [Microsoft.SharePoint.Publishing.PublishingCache]::FlushBlobCache($webApp) Write-Host "Flushed the BLOB cache for:" $webApp Hope this script will solve problems of people facing issues with SharePoint BLOB cache.

Release SharePoint site Lock using PowerShell Script

In this blog post I'm going to show you a PowerShell Script for releasing site lock. Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue $Admin = New-Object Microsoft.SharePoint.Administration.SPSiteAdministration("http:// sitecollection ") $Admin.ClearMaintenanceMode() $site = Get-SPSite -Identity "http://sitecollection" Write-Host $site.MaintenanceMode Hope this will help people facing the lock problem in SharePoint.

Download All Documents in SharePoint Web using Powershell Script

Image
In this blog post I'm going to show you how to download all document using Powershell script on your local drive. Please follow the below steps: 1. Creating commandlet bindings (command variables) 2. Add-PSSnapin statement for importing SharePoint library. 3. Now creating a recursive function for traversing all the folders in the specified folder and downloading it to local folder. In the second foreach loop we are checking if Folder not exists on local drive then create the folder and then call DownloadAllItemInFolder function recursively. 4. Create the instance of Site, Web and Folder to call  DownloadAllItemInFolder function. Once the downloading finished, dispose off the Site object. Full script can be downloaded from here . Below is the sample command to run this script. .\DownloadSPFiles -SiteCollectionUrl "http://siteurl" -SPFolderPath "<Folder>" -LocalDir "C:\BackupFiles" In that script I've used the Root Web for...

OrgChart Using JQuery and SharePoint List

Image
In this blog post I'm going to display how to build our own Organization chart with the help of JQuery by fetching data from SharePoint List. In this example, I've used the standard jQuery.Orgchart library from this link . Please follow the below steps to generate the Chart: Create a SharePoint List using custom list template and define the hierarchy Create a lookup column of same list. Example, Supervisor column is a lookup of 'Org Chart' list. Now add a content editor webpart on a page. add the jquery references in content editor webpart. <link rel="stylesheet" href="_layouts/jquery.orgchart.css" /> <link rel="stylesheet" href="_layouts/jquery-ui-1.10.3.custom.css" /> <script src="_layouts/jquery-1.9.1.js"/> <script src="_layouts/jquery-ui-1.10.3.custom.js"/> <script src="_layouts/jquery.orgchart.js"/>  Now create a new customorgchart.js file into s...

Multiple Background Images in HTML

In this article I’m going to demonstrate how we can use multiple background images for any html element. Those who have knowledge of HTML5 and CSS3 can do it easily using the already provided functionality. But all browser’s doesn’t support HTML5 and CSS3, so for these browser to work we need to do little customization. First I’ll demonstrates how to Use multiple background images in HTML5 and CSS3 Use multiple background images in lower versions of browser.   Multiple background images in HTML5 and CSS3 With CSS3 we case easily define multiple backgrond images in a single line like this background:url('../images/bg2.jpg') fixed left top no-repeat, url('../images/bg2.jpg') fixed right top no-re peat,url('../images/bg_strip.jpg') fixed center top repeat-x;  Workaround for unsupported browsers Some browser doesn’t support multiple background images (example IE 8 and below versions, Firefox 13 and below versions), so as a workar...

Clear SharePoint Site’s Recycle Bin using PowerShell Script

In this blog post I’m going to display how to delete all items from recycle bin of any SharePoint Site using PowerShell script. Steps: PowerShell script we can get the object of SPSite and SPWeb like this $Site = Get-SPSite “SiteUrl” $RootWeb = $Site.RootWeb We can iterate through all the subsites in any site using foreach loop foreach($web in $RootWeb.Webs) Next we need to call the DeleteAll method of Recycle Bin. {       $web.RecycleBin.DeleteAll(); } Next we need to clear the level 2 recycle bin i.e. at site collection level $Site.RecycleBin.DeleteAll(); And lastly we need to dispose the SPSite object $Site.Dispose();   That’s all you need to delete all items from recycle bin.