Wednesday, June 29, 2016

Site Collections Size report

Wanted to quick script to get all site collections size along with their last modified dates, visits. PowerShell is cool enough to do that in two lines.

Get-SPSite -limit All | select url, @{label="Size in MB";Expression={"{0:N2}" -f ($_.Usage.Storage/1000000)}},@{label="ContentDB";Expression={$_.ContentDatabase.Name}},@{label="Visits";Expression={$_.usage.Visits}},@{label="lastmodified";Expression={$_.RootWeb.LastItemModifiedDate}}  | epcsv SiteReport.csv -NoTypeInformation

Thursday, June 23, 2016

Reviving datasheet view in SharePoint 2013 for selective sites


 In SharePoint 2013 the datasheet view is deprecated by Microsoft and Quick edit was promoted. Datasheet view is an ActiveX component which has tight dependency with Internet Explorer and Quick Edit is based on HTML 5, CSS and JS achieving cross platform and cross browser compatibility.
                Datasheet view in legacy platform is ideal for doing bulk row edits and inserts without facing performance issues with few caveats.

How Data Sheet view works?

Datasheet view is an ActiveX component called ListNet from STSList.Dll which accept the below parameters to work properly
  • ListName
  • ViewGuid
  • RootFolder
  • ListWeb
  • ListData
  • ViewSchema
  • ListSchema

Pros and Cons

 Pros

  •  Users will get the legacy control to work in the same fashion without the need of exporting to excel.

Cons

  • Document Center is not supported.
  • Managed metadata is not supported.
  • Cross browser and Cross platform incompatible.

Wednesday, July 2, 2014

SharePoint grayed out Multiple file uploader option

After upgrading to Internet Explorer 11 and Office 2013, while trying to do multiple file upload to a SharePoint document library, it was grayed out.

I've ensured the STSUPLD control in Addons menu, verified the 32 bit version of Internet explorer is loading the site. But still there is no luck and also i'm unable to access the Datasheet view of the document library or a list.

The trick is to un-check the "ActiveX Filtering" option from Tools menu. Additional browser security...




Thursday, March 14, 2013

Deploy SharePoint solutions at web application level

SharePoint solution packages by default get installed to "Globally" scope when you don't have any resources which are web application scoped. It is not a logical decision to deploy in web application scope when I have Assemblies to GAC, Application pages to Layouts folder etc. If there are any resources which are targeted at web application scope like deploying assemblies at Application bin directory, safe control entry etc then the solution deployment will force us to deploy at web application level.

Some times you will have assemblies to GAC, not a web part project and don't have any resources which are scoped against web application. At this juncture, you may need to deploy the solution at web application scope for various reasons like

  • Security  - To hide features part of the solution from showing off in other web applications.
  • Shared Environment - Other applications running in the Farm and they don't to get impacted of your WSP
  • Isolation - Having a global scoped WSP will recycle all app pools during deployment
This can be achieved by adding a safe control entry to the solution package and solution deployment script will be satisfied by this. If it is MOSS 2007 then its matter of Manifest.xml modification. But SharePoint 2010 is powered with Visual Studio 2010 tools for SharePoint, if we make any modification to Manifest.xml then the Package designer will ignore its support to the developer.

The solution would be, open your package designer, scroll down and find the Advanced Tab, click on "Add" button to add additional assemblies.



Select "Add assembly from project output", input the namespace and full assembly name for the safe controls.

Save these settings and hit on Ok button,one more setting to update. Click on the project in solution explorer and press F4 to open the properties window, exclude the assembly from being copied to solution package.Because we already added the assembly in "Additional Assembly" section.


Package and deploy the solution at web application level scope.

Thursday, February 14, 2013

Portable mail server on desktop for SharePoint

I used to run an SMTP server which comes along with IIS 6.0 whenever I need to test an outgoing emails from a custom SharePoint solution. After a long time I hate running a server process just to receive a bunch of emails relayed within my development machine and also due to compliance, network administrators may block the SMTP server in a desktop.

Here comes a nifty tool from Codeplex called Papercut for all our problems. Ok, how to resolve the SMTP puzzle ?


  1. Download Papercut from CodePlex, unzip the zip package (Note: there is no msi package or a setup.exe, so you are not violating software compliance too) and keep it in a handy location
  2. Find your machine IP first by using ipconfig and make a note.
  3. Map your IP to SharePoint’s outgoing mail settings in SharePoint Central Administration console.



Open PaperCut.exe -> click on “Options” -> Map your machine IP here. Keep it open and running, do not close.


Now test all your email functionalities and you should be seeing all emails in the left pane with time stamp.

Watch all your mails are being forwarded to Papercut.exe.


Wednesday, January 30, 2013

SharePoint User Profile Service - method not found exception

While trying to access user profile service application in few machines, there came this exception


Method not found: 'Microsoft.SharePoint.Administration.SPIdentifierType Microsoft.SharePoint.Administration.SPAce`1.get_BinaryIdType()'

we were unable resolve by re provisioning the service application, restarting the timer jobs and restarting the servers. As this exception arises from a SharePoint assembly, looked at the version of the server and found it is SharePoint 2010 RTM version.

It requires following updates to resolve the issue


Don't forget to run the PSConfig wizard after installing Service pack and cumulative updates.

Re-provision the User profile service application and proceed.

Tuesday, October 30, 2012

Shredded Storage in SharePoint 2013

How many times we thought through before enabling versions for a specific document library which will handle files of huge size during the capacity planning exercise in MOSS 2007 and SharePoint 2010.

After enabling versions in a document library, imagine there is a DSTD.docx of 20 MB word document of v1.0 in that document library and user is attempting to edit this document. SharePoint 2010 server will serve the full document to the MS Office Word Client. After making changes to couple of page, when the user hit the Save/Sync button, SP 2010 gets the full 20 MB modified document and stores it as a seperate entry in content database.

Say if we run across ten major versions of this specific document in SP 2010, the disk space occupied by this document in Sql Server content database would be 20MB * 10 versions= 200 MB

SP2013 changes this scene by using the Shredded storage technique, if you were a DB admin or an IT Pro the you should have heard about Differential backups or incremental backups. Shredded storage is similar to this.

In SP2013,   when the user hit the Save/Sync button after making changes in DSTD.docx v1.0 , SP 2013 gets the delta changes in that modified document and add an entry in content database.

So in SP 2013 enabling the versions is not gonna eatup disk storage, reduces disk I/O as only the delta is getting stored and efficient use of network bandwidth.