Monday, April 9, 2012

Sql Authentication and Windows impersonation


Recently i was working on a BCS solution in SharePoint 2010 and realized a scenario where i have to authenticate SQL Server database with a windows user account for all authenticated users using a connection string.
after trying a good four hours on topic i found there is no easy way where you can provide a service windows account as an account for sql authentication in connection string. so i used a sql server account for such impersonation in connection string with username and password.
 
but the question was still in my mind for is it the way designed or i missed something which i should know. Then i thought to explore and i found it true. WHY?, next question you might put up and the reasons are below
  • When integrated security is "true" or "SSPI" What is SSPI? the basic assumption it uses current thread's identity for authentication with SQL Server, so impersonate the current thread to achieve the scenario.
  • With windows impersonation in sql server connection string might trouble you incase your enterprise wide password maintenance policy (i.e. change password every quarter).
  • Risk of identoty theft i.e. you need to know the password of windows user (although service dummy account can be used to overcome this factor but it again becomes overhead for It support team).
Further Readings:

Thursday, December 1, 2011

Invalid look up error in SharePoint 2010

Invalid look up error in Sharepoint 2010 when try to upload document in Library
Genrally when we download or migrate a document from one sharepoint library to another, document contains metadata also. the same metadata conflict when there is already a a same column also in new library but with different datatype e.g. string and managed metadata

To resolve the issue follow Open Document and Go to File menu > Properties and  select custom tab in window> find if any of the value conflicting with existing columns in document library
this should be most probably Document type/ Author etc.

delete the property and upload the document again. these settings applies to Word 2003 documents. similar can be found in word 2007/2010 documents

Friday, October 22, 2010

Site Definition in Microsoft SharePoint Server 2007

Following steps are included in creating a custom site definition:

  • Create a folder named “mySiteDef” at C:Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Template\Site Templates\ 
  • Create a subfolder “XML” and create the onet.xml in it. The following kinds of tasks can be performed in a custom Onet.xml to create a custom site definition: 
    • Specify an alternate cascading style sheet (CSS) file, JavaScript file, or ASPX header file for a site definition.
    • Modify navigation areas for the home page and list pages
    • Add a list definition as an option to the Create page
    • Add a document template for creating document libraries
    • Define one or more configurations for the site definition, specifying the lists, modules, files, and Web Parts that are included when a site definition configuration is instantiated
  • It contains the following tags to define various items in a site definition. A sample onet.xml can be found at 12\TEMPLATE\SiteTemplates\SPS\XML folder in sharepoint farm (Same can be done through by copy existing site definition).
  • Within the “C:/Program Files/Common Files/Microsoft Shared/web server extensions/12/Templates/1033/XML” directory create a new file called webtempSiteMinder.XML. At run time the compiler will merge the information contained in this file with the information contained in the original WEBTEMP.XML file to specify which site templates are available for creating new sites
  • Enter the following XML into the webtempSiteMinder file as follows to create the new site definition.
<?xml version="1.0" encoding="utf-8"?>
<!-- _lcid="1033" _version="12.0.4518" _dal="1" -->
<!-- _LocalBinding -->
<Templates xmlns:ows="Microsoft SharePoint">
<Template Name="MYSITEDEF" ID="325202">
<Configuration ID="1" Title="MYSITEDEF" Hidden="FALSE" ImageUrl="/_layouts/images/blogprev.png" Description="MYSITEDEF Subsite" DisplayCategory="Custom" > </Configuration>
</Template>
</Templates>

  • Each WEBTEMP.XML file contains a collection of Template elements and Configuration sub-elements, which identify to the compiler all the site definitions that can be instantiated. The Configuration elements define a title, a description, and a URL for the image displayed in the user interface, properties common to each Web Site created using the site definition.
  • It is important to make sure that each Template element defined in the WEBTEMP file contains the identical Name in all capital letters that is assigned to the new folder created above. Also, as a best practice when creating new templates to avoid conflicts with existing sites use a unique value that is greater than 10,000 for the ID attribute.
  • Once created the various site elements can be edited using Microsoft office sharepoint designer.