Thursday, 24 November 2016

Step by Step Creation of External List in SharePoint 2010

BCS (Business Connectivity Services) is the successor of BDC (Business Data Catalog), but we have great features available in BCS. Now the data from External systems can be managed as a List in SharePoint and the data operations like create, edit, delete is made possible from the list.
Let’s see step by step creation of External List in SharePoint. In this Example am using SQL Table as External Source.
Open the Site in SharePoint Designer
Click on External Content Types
Click on External Content in Ribbon to create new content type
Specify the values for Name and Display Name, Click on “discover external data sources and define options.”
In the Data Connections Screen, Click on Add Connections
Select the Data Connection type, here I am trying to connect to “Adventure works” SQL Database.
In the next screen specify your connection settings to the database and click OK.
Now the screen will list the database and its tables. Choose the required table and right click to select the operations to be performed on the list.
In Wizard choose the input parameter fields.
In Filters section, you can specify the filter for records.
Now the External Content Field will be looks like below with operations, fields & parameters.
Click on Create Lists & Form for the External Content type in Ribbon.
Specify the list details, if you need to have InfoPath forms for list forms, select “Create InfoPath Form”
Now Set Permission for Business Data Connectivity Services in Central Admin:
Go to Central Administration -> Application Management -> Manage Service Applications -> Business Data Connectivity Service
Select the Store and Click on Set Metadata store permissions.
Select the User and choose appropriate permissions.
Open the list in site.
Now the data can be accessed from SharePoint list.

Thursday, 10 November 2016

How do I check in Multiple files Under Multiple folders at a time

When we have folder structure inside a document library, it is difficult to check all the files at single time. because it shows all the folder instead of files to users, by default SharePoint takes the items(folders) to check in without the items inside it. There is a very nice way to achieve this by creating another view. so that views can be switched whenever the users wants to check in multiple files. Here is the way:
Step 1: Go to document Library. Create a new view:
Documents1
Documents2
Step 2: Create standard View:
Documents3
Step 3: Give a unique name to the view:
Documents4
Step 4: Scroll down and give the folders filter as shown below and then save it.
Documents5
Step 5: Now you can switch the view to find all the items without folder:
Documents6
Step 6: Now all multiple files can be checked in without any issues inside  folders:
Documents7


Monday, 7 November 2016

Site slowness - STS certificate

Site slowness because of SharePoint STS certificate CRL checking

Symptoms
Assume that you have a web application that uses claims-based authentication in SharePoint Foundation 2010 or SharePoint Server 2010. The SharePoint server does not have access to the Internet, or the server is protected by a firewall that has limited ports open. In this situation, users intermittently experience long delays when they perform certain operations, such as logging in to the site or performing a search. Users may also encounter HTTP timeouts when they perform these operations.
Cause
SharePoint uses certificates to sign security tokens that are issued by the Security Token Service (STS). Like all certificates, the validity of the STS certificate has to be verified periodically to make sure that the certificate has not been revoked. By default, the root certificate in the chain is not added to the Trusted Root Certificate Authorities store of the SharePoint servers. Because of this, the certificate revocation list (CRL) check for the certificate is performed over the Internet. If the online CRL server cannot be reached from the SharePoint server for some reason, the operation times out after 15 seconds by default. Even if the CRL validation fails after 15 seconds, the SharePoint page may still be rendered after the delay.

Certificate validation failures can be tracked by enabling the CAPI2 event logging on the SharePoint server. When CAPI2 event logging is enabled and Internet certificate validation is failing, you will frequently see the following error messages in the CAPI2 event log:
  • Build Chain Error

    Event ID: 11
    Task Category: Build Chain
    subjectName (taken from event details): SharePoint Security Token Service
  • Retrieve Object from Network Error

    Event ID: 53
    Task Category: Retrieve Object from Network
    URL (taken from event details): http://download.windowsupdate.com/msdownload/update/v3/static/trusted/en/authrootstl.cab
Please refer to the "More Information" section for information about how to enable CAPI2 logging.
Resolution
To resolve this issue, perform one of the following workarounds:

Workaround 1

Install the SharePoint Root Authority certificate in the Trusted Root Certification Authorities store. After the root certificate is added to the local certificate store, the certificate validation is no longer performed over the Internet. The below steps will cause the BuildChain to succeed by finding the certificate in the local store, therefore eliminating the need for the retrieval of an object from the network. The following steps have to be completed on each SharePoint server in the farm to add the root certificate to the local certificate store:
  1. Export the SharePoint Root Authority certificate as a physical (.cer) file. Start the SharePoint 2010 Management Shell as an Administrator,and then run the following Windows PowerShell commands:
    $rootCert = (Get-SPCertificateAuthority).RootCertificate 
    $rootCert.Export("Cert") | Set-Content C:\SharePointRootAuthority.cer -Encoding byte
    Note This will export the internal root certificate (.cer file) for SharePoint to Drive C. You can copy and use this file on all servers in the farm for importing without having to run the PowerShell commands again.
  2. Import the SharePoint Root Authority certificate to the Trusted Root Certification Authorities store. To add the SharePoint Root Authority certificate to the Trusted Root Certification Authorities store, follow these steps:

    Note "Administrators" is the minimum required group membership to complete these steps.
    1. Tap or click Start, type mmc in Start search, and then press Enter.
    2. On the File menu, click Add/Remove Snap-in.
    3. Under Available snap-ins, click Certificates, and then click Add.
    4. Under This snap-in will always manage certificates for, select Computer account, and then click Next.
    5. Select Local computer, and then click Finish.
    6. If you have no more snap-ins to add to the console, click OK.
    7. In the console tree, double-click Certificates.
    8. Right-click the Trusted Root Certification Authorities store.
    9. Click All Tasks, click Import to import the certificate, and then follow the steps in the Certificate Import Wizard.

Workaround 2


Disable the automatic update of root certificates on the SharePoint Servers. To do this, follow these steps:
  1. Under the Computer Configuration node in the Local Group Policy Editor, double-click Policies.
  2. Double-click Windows Settings, double-click Security Settings, and then double-click Public Key Policies.
  3. In the Details pane, double-click Certificate Path Validation Settings.
  4. Click the Network Retrieval tab, select the Define these policy settings check box, and then clear the Automatically update certificates in the Microsoft Root Certificate Program (recommended) check box.
  5. Click OK, and then close the Local Group Policy Editor.
  6. Run gpupdate /force to make the policy take effect immediately.

Note With auto-update disabled, you may have to monitor KB 931125 for new releases, and then manually update the certificate trust as required.

Implications of disabling automatic root certificate updates
There should not be specific implications to SharePoint because we are using self-signed certificates and manage them ourselves. The SharePoint certificates do have an expiry, but there is a health rule that watches for this and then warns the administrator to update or re-roll them.

The main aspect to consider is for other certificates that are used on the computer (such as SSL certificates, certificates to trust download packages or for SAFER policy, and so on) which are issued from certificates chained to those in the Trusted Root Certification Authorities store.

More information
Enable CAPI2 Diagnostics logging from the Event Viewer UI or from command line scripts by using the following instructions (which are documented in the Troubleshooting PKI Problems on Windows Vista white paper).


Enable and save the CAPI2 log from the Event Viewer UI

  1. Open Event Viewer. To open Event Viewer, click Start, click Control Panel, double-click Administrative Tools, and then double-click Event Viewer.
  2. If the User Account Control dialog box appears, confirm that the displayed action is what you want to perform, and then click Continue.
  3. In the Console pane, expand Event Viewer, expand Applications and Services Logs, expand Microsoft, expand Windows, and then expand CAPI2.
  4. You can now perform the following actions:
    • To enable CAPI2 logging, right-click Operational, and then select Enable Log.
    • To save the log to a file, right-click Operational, and then select Save Events as. You can save the log file in the EVTX format (which can be opened through the Event Viewer) or in the XML format.
    • To disable CAPI2 logging, right-click Operational, and then select Disable Log.
    • If there is data present in the log before you try to reproduce the problem, we recommend that you clear the log. This allows for only the data relevant to the problem scenario to be collected from the saved log. To clear the log, right-click Operational, and then select Clear Log.
    • For CAPI2 Diagnostics, the log can grow in size quickly, and we recommend that you increase the log size to at least 4 megabytes (MB) to capture relevant events. To increase the log size, right-click Operational, and then select Properties. In the log properties, increase the maximum log size.

      Note The default size for the event log is 1 MB.