The secure sockets layer (SSL) certificate sent by the server was invalid and this item will not be crawled – Sharepoint


On starting the full crawl of the default content source i recieved the  error.

The secure sockets layer (SSL) certificate sent by the server was invalid and this item will not be crawled.

It was because one of the site was ssl enabled.

Solved it in the following manner

Go to

Central Administration > Application Management > Search Service > Farm-Level Search Settings

On the Manage Farm-Level Search Settings page, in the SSL Certificate Warning Configuration section, select the Ignore SSL certificate name warnings check box if you want to trust that sites are legitimate even if their certificate names are not exact matches.

http://technet.microsoft.com/en-us/library/cc262907.aspx

Bye

Data at the root level is invalid. Line 1, position 1. Sharepoint


Got this error while opening a sharepoint site.

Changing custom error to Off it showed  the following error

Line 1:  <browsers>
Line 2:      <browser id="Safari2" parentID="Safari1Plus">
Line 3:          <controlAdapters>

Data at the root level is invalid. Line 1, position 1.

Deleted  the _vti_cnf folder of /App_Browsers/ of the site and everything was back to normal!!!

The connection has been dropped because the principal that opened it subsequently assumed a new security context, and then tried to reset the connection under its impersonated security context. This scenario is not supported. See “Impersonation Overview” in Books Online.


I got this error while I was writing code to retrieve data from CRM’s filtered view.

Here we just need to modify the connection string by adding Pooling=false

SqlConnection connection = new SqlConnection(“Data Source=dsname;Initial Catalog=dbname ;Integrated Security=SSPI; Pooling=false);

Bye

Using filtered view in Callout and Plugin


For using filtered view within the callout/plugin I used the following code

SqlConnection connection = new SqlConnection(“Data Source=dsname;Initial Catalog=dbname ;Integrated Security=SSPI;”);

string sqlQuery = @”select * from filteredOpportunity”;

SqlCommand cmd = new SqlCommand(sqlQuery, connection);

connection.Open();

//// your logic here

connection.Close();

 

But this code wasn’t returning any results .It was because callout/plugin run under the context of NT Authority\Network Service.

So we need to use impersonation in this case, for this we can use the following code

 

SqlConnection connection = new SqlConnection(Data Source=dsname;Initial Catalog=dbname ;Integrated Security=SSPI; Pooling=false”);

string sqlQuery = @” SETUSER ‘domainname\administrator’ select * from filteredOpportunity;

SqlCommand cmd = new SqlCommand(sqlQuery, connection);

//// your logic here

connection.Open();

 

SETUSER – To impersonate the admin who has access to the filtered views. More about SETUSER

http://msdn.microsoft.com/en-us/library/ms186297.aspx

 

Pooling-False This is important otherwise we will get the below error

 

The connection has been dropped because the principal that opened it subsequently assumed a new security context, and then tried to reset the connection under its impersonated security context.

Check this wonderful post as well

http://blogs.msdn.com/b/crm/archive/2007/05/21/writing-crm-callouts-with-filtered-views.aspx

 

Bye

 

Could not load XSL file. The system cannot find the file specified. (Exception from HRESULT: 0x80070002) Content By Query Web Part


We recieve this error while trying to edit ContentByQueryWebPart.

The reason for this error is because the publishing features are not enabled for the site.

So we need to enable the publishing features.

For this first activate Office Sharepoint Server Publishing Infrastructure feature found at

Site Collection Administration – Site Collection Features.

Than enable Office Sharepoint Server Publishing feature at Site Administration- Site features

Bye

Preventing your system from getting auto locked


Within most of the organization, there is a default setting that after a few minutes have escaped, the system gets locked itself, if system is left unattended. Well to prevent this i have written a small utility (windows application) which periodically sends user input to the system, making it to believe that some mouse movement has been made and thus stopping the system from getting locked.

Here we would be calling SendInput function within user32.dll

The SendInput function synthesizes keystrokes, mouse motions, and button clicks and that is what we need.

http://msdn.microsoft.com/en-us/library/ms646310.aspx

This is useful in case we are giving presentation or else reading some documents …

Following is the code for the same

1) Create a new windows application in C#

2) Add a button named btn_Unlock to it and a timer control named timer1.

3) Set enabled to false and interval to 120000 for timer control.

4) Put the following code to your form class


public partial class frmKU : Form

{

public
frmKU()

{

InitializeComponent();

}

[DllImport(“User32.dll”, SetLastError = true)]

public static extern int SendInput(int
nInputs, ref INPUT
pInputs, int cbSize);

public struct INPUT

{

public
int type;

public
MOUSEINPUT mi;

}

public struct MOUSEINPUT

{

public
int dx;

public
int dy;

public
int mouseData;

public
int dwFlags;

public
int time;

public
int dwExtraInfo;

}

// Call the
API

int
resSendInput;

private
void btnUnlock_Click(object
sender, EventArgs e)

{

timer1.Enabled = true;

INPUT
input = new INPUT();

resSendInput = SendInput(5, ref input, Marshal.SizeOf(input));

}

private
void timer1_Tick(object
sender, EventArgs e)

{

INPUT
input = new INPUT();

resSendInput = SendInput(5, ref input, Marshal.SizeOf(input));

}

}

 

Bye …

Nishant Rana's Weblog

Everything related to Microsoft .NET Technology

Skip to content ↓