Showing posts with label Hack. Show all posts
Showing posts with label Hack. Show all posts

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.

Friday, October 22, 2010

Fetching from SharePoint Lists using ACE OLE DB

There are varieties of ways available to access a sharepoint list object model, web services, RPC, DAV. Recently gotta chance to work with Microsoft ACE OLE Db objects, while playing with the object came across a strange connection string from Connectionstrings.com which just provides a connection string for a sharepoint list.

This approach is not officially documented anywhere, I thought of giving it a shot and its working too. Here's the code to display values fetched from SharePoint list using OLE DB data reader.



string connString = "Provider=Microsoft.ACE.OLEDB.12.0;WSS;IMEX=2;RetrieveIds=Yes; DATABASE=http://foo/;LIST={7F72D985-5219-4E8A-AA56-C4473902A333};";
OleDbConnection conn = new OleDbConnection(connString);
            conn.Open();
OleDbCommand command = new OleDbCommand("select * from States", conn);
            OleDbDataReader dataReader = command.ExecuteReader();
            while (dataReader.Read())
            {
               Console.WriteLine(dataReader["Title"]);
             }



This approach is strictly for development environment ONLY.

Thursday, September 17, 2009

How to find the site template used on a Site ?

Some times I stumble upon some heavily modified sites to find out the site template(Team site/Blank site etc) used for provisioning that instance. That's quite easy using the object model but I wondered is it possible through some out-of-the box tool or UI's

Recently came across the WSS RPC methods It has a function called GetProjSchema which does this magic

Authenticate with the web application

Remove all strings after the site name from the address bar and append the following string

/_vti_bin/owssvr.dll?Cmd=GetProjSchema

So if you have application as Foo and it has a site called PWA then the URL might be looking like this

http://Foo/PWA/_vti_bin/owssvr.dll?Cmd=GetProjSchema

GetProjSchema requests the CAML Schema for a Web site, this is a blend of ONET.XML for that specific site definition and some resources which are related to that provisioned site instance. This CAML schema is cached in IIS, so we've retrieved this cached version to find out the site template

This gives more details than required but we are now interested in the site template used, look at the first line "Project Title=". This is the current site template being used

A sample screen snap


Anything which comes OOTB capable of solving real world problems is good. Exploit the rendered CAML . .. .

Friday, September 5, 2008

Retrieving the password for IUSR & IWAM accounts

IIS provides  a script file called adsutil.vbs to obtain or set the password for IUSR/IWAM accounts in IIS metabase. Just adding this tip not to forget in future.

More details : http://support.microsoft.com/default.aspx?scid=kb;en-us;297989