Sunday, January 20, 2013

SharePoint Content DB size mismatch

Hi, Once you enable the quota limit in central admin for a site collection and do check the _layouts/storman.aspx page, you are able to see the site storage space. But, you may find some difference in the actual content db size and the statistics shown in the above page. To recalculate it again, use the below power shell script. $site=get-spsite -identity http://sitecollectionurl $site.RecalculateStorageUsed()

Saturday, January 19, 2013

Back up the farm using power shell

I got a requirement from my client to take the backup of the farm on a weekly basis using automated scheduler.

we do have a standard powershell cmdlet, that helps us in taking the back up of farm using backup-spfarm cmdlet.

We could do the job on a dialy or weekly basis with power shell script and windows task scheduler.

After I searched for some time , I got an excellent blog from http://sharepointpolice.com/ .

Here is the same script , I used for my farm.

How to hide recently modified documents in the masterpage

Hi All, Just want to note my small work on hiding recently modified document link in the sharepoint site. If you want to do it for all pages in the site, go to master page of the site using designer and write the below css snippet in the head tag. If you want to hide the same for a particular home page only, add the same css in CEWP webpart.

Hide fields in the list view web part using jquery

Hi Guys,

I had a requirement to hide the list fields in the list view web part.

For example, in a workflow, I have a course training custom list with multiple columns, where the students want to enter their data like name, course required, timings etc and course  faculty need to see additional fields like approved/rejected, his availability etc.

For students, they should not see approved column while they submit the course request.

This could be possible through  a simple j query, in a content editor web part with specifying target audience.

Here is the jquery code.

$('nobr:contains("Approved")').closest('tr').hide(); //"Approved" is your required column to hide.

The code works like this
When you go to view source of the page, you could see the fields names with the tag "nobr" associated to it. So query those tags with jquery selector and hide its nearest 'tr'.

So if the above code does not work for you, make sure  to check the view source of the page and see the field name tags.