Wednesday, December 29, 2010

Cannot open log for source ‘Custom_Web_Part’. You may not have write access

In a SharePoint site, When I logged in as an administrator, all pages accessed successfully. But as a regular user it scolded me with Access denied Error :-)


Enabled the stack trace and Turned off custom error message page to get the actual error.

Error detail: System.ComponentModel.Win32Exception: Access is denied. Below it, in the stack trace, another exception popped: InvalidOperationException: Cannot open log for source ‘My_Web_Part’. You may not have write access.
 
Cannot open log for source My_Web_Part. You may not have write access.

This is because non-administrators do not have the permission to write on the event log. So for this problem, just grant non-administrator users permission to write on the event log.

  1. Open registry editor by typing "regedit" in run box.
  2. Navigate to: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Eventlog\Application
  3. Look for CustomSD, it should contain string:
     O:BAG:SYD:(D;;0xf0007;;;AN)(D;;0xf0007;;;BG)(A;;0xf0007;;;SY)(A;;0x7;;;BA) (A;;0x7;;;SO)(A;;0x3;;;IU)(A;;0x3;;;SU)(A;;0x3;;;S-1-5-3)

    The string is formatted as an SDDL, you can find more information about the format at Microsoft’s site.
  4. Now change the value to give the event log’s read-write permission to all authenticated users. To do this, append the string (A;;0x3;;;AU) to the entry CustomSD, So it becomes:

        O:BAG:SYD:(D;;0xf0007;;;AN)(D;;0xf0007;;;BG)(A;;0xf0007;;;SY)(A;;0x7;;;BA) (A;;0x7;;;SO)(A;;0x3;;;IU)(A;;0x3;;;SU)(A;;0x3;;;S-1-5-3)(A;;0x3;;;AU)
Always, Its a best practice to Backup registry before you do any change.


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Monday, December 27, 2010

How to Add Banner image in SharePoint - Simple way

Banners are the great way to add branding to SharePoint site. There are lot of ways to add banner in SharePoint, Here I'm going to illustrate a easy way to add Top banner in SharePoint.

In SharePoint 2010:
In SharePoint 2010, CSS class you have to pick and modify is: .s4-title
.s4-title
{
background-image: url("/_layouts/images/banner.png") #FECF2C no-repeat;
}

For MOSS 2007:
In SharePoint 2010, the CSS class you have to pick and modify is: .ms-globalbreadcrumb
So, override this class as:

.ms-globalbreadcrumb
{
background-image:url("/_layouts/images/banner.jpg");
padding:2px 10px 80px 5px;
}


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Sunday, December 26, 2010

You may be trying to access this site from a secured browser on the server. Please enable scripts and reload this page.

Internet explorer displays the message at top "You may be trying to access this site from a secured browser on the server. Please enable scripts and reload this page."?
You may be trying to access this site from a secured browser on the server. Please enable scripts and reload this page.

Fix is: This is because Internet Explorer Enhanced Security Configuration. So simply disable IE ESC to fix this issue.

Go to "Start >> Administrative Tools >> Server Manager >> Configure IE ESC >>Select Off for Administrators and click OK.
Configure Internet Explorer Enhanced Security - IE ESC
This may happen you you have IE developer tool and disabled scripts! just uncheck "Scripts" under Disable Menu to rectify. Adding site to Trusted Sites zone on Internet Explorer also fixes the problem.

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Thursday, December 23, 2010

Exclude SharePoint Folders from Antivirus

In SharePoint servers, some of the SharePoint, IIS, SQL Server folders should be excluded from anti-virus protection in order to avoid performance hits!

such as: (C:\ may be other drive as well)
  • C:\Program Files\Microsoft Office Servers\14.0\Logs 
  • C:\Program Files\Microsoft Office Servers\14.0\Data.
  • C:\Program Files\Microsoft Office Servers\14.0\Bin
  • C:\Program Files\Microsoft Office Servers\14.0\Synchronization Service, 
  • C:\Documents and Settings\Default User\Local Settings\Temp,
  • etc
There are many First party/third party products offers Antivirus plug-in for SharePoint:
http://www.microsoft.com/forefront/sharepoint/en/us/product-overview.aspx
http://us.trendmicro.com/us/products/enterprise/portalprotect/index.html

Thanks to: http://vspug.com/bobbyhabib/2008/04/22/moss-anti-virus-guidelines/

Microsoft KB addressing this issue: http://support.microsoft.com/kb/952167
For SQL Server: http://support.microsoft.com/kb/309422
IIS: http://support.microsoft.com/kb/821749 

For SharePoint 2013, Exclude these folders from Anti-Virus: http://support.microsoft.com/kb/952167

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Wednesday, December 22, 2010

Log Errors to Windows Event Log or SharePoint Log Programmatically

Using Windows Event - Logs
During development its worth to log errors either in Windows Event log or in SharePoint log files for further troubleshooting.

try
{
//Do something
}
catch (Exception ex)
{
SPSecurity.RunWithElevatedPrivileges(delegate
{
System.Diagnostics.EventLog.WriteEntry("My Custom Solution", ex.Message + " Inner Exception: " + ex.InnerException + " Call Stack: " + ex.StackTrace, EventLogEntryType.Error);
});
}

Beside this you can also use Trace.write or Debug.write



Use SharePoint Log Files:
try
{
//Do something
}
catch (Exception ex)
{
 //In SharePoint 2010
 SPDiagnosticsService.Local.WriteTrace(0, new SPDiagnosticsCategory("My Custom Solution", TraceSeverity.Unexpected, EventSeverity.Error), TraceSeverity.Unexpected, ex.Message, ex.StackTrace);
  
 //In MOSS 2007
 Microsoft.Office.Server.Diagnostics.PortalLog.LogString("Exception Occurred: {0} || {1}", ex.Message, ex.StackTrace);
 
}


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Sunday, December 19, 2010

All People Link in SharePoint 2010

"All People" is really helpful if you want to see who are all the people have access to site and if you want to delete the user from site completely in SharePoint 2007, as shown below.

All People Link in SharePoint 2010

But in SharePoint 2010 All People Link is missing!!!  Don't panic. We can get it back by a simple trick.

So What is the trick? 
The trick is: Navigate to : "http://Your-SharePoint-site/_layouts/people.aspx?MembershipGroupId=0"

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Saturday, December 18, 2010

Extract line by Line in Nintex workflow

Through lazy approval in Nintex workflow, I had to extract the approver's comment line by line. Using Regular expressions in Nintex workflow we can accomplish that.
Extract line by Line in Nintex workflow

Regular expressions:

Regular expressions in Nintex Workflow

 Here the "ApproverComments" is a collection variable. You can extract from the collection and update the list using For-each & Run-If conditions

Get the 3rd line:


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Thursday, December 16, 2010

Fix for SharePoint Datasheet Error: The list cannot be displayed in Datasheet view for one ore more of the following reasons

When I try to open a SharePoint 2010 list in Datasheet View, It scolded me by throwing below error:

The list cannot be displayed in Datasheet view for one ore more of the following reasons:
   - A datasheet component compatible with Microsoft SharePoint Foundation is not installed.
   - Your Web browser does not support ActiveX controls.
   - A component is not properly configured for 32-bit or 64-bit support.
The list cannot be displayed in Datasheet view for one ore more of the following reasons - SharePoint Datasheet Error
Or you may face the similar issue:
"The list is displayed in Standard view. It cannot be displayed in Datasheet view for one or more of the following reasons: A datasheet component compatible with Microsoft SharePoint Foundation is not installed, your browser does not support ActiveX controls, a component is not properly configured for 32-bit or 64-bit support, or support for ActiveX controls is disabled."


First, you need to have an Office installation in order to use the datasheet view.

Yes, You may have Ms-Office installed. but the Edit in Datasheet view functionality is not supported if you install 64-bit Office 2010. However, the functionality is available if you install 32-bit Office 2010. The ActiveX control needed for the datasheet view is incompatible with the 64 bit version of Office.

Fix: Install Office 2007/2010 Access Runtime - Data Connectivity Component:

KB: http://support.microsoft.com/kb/2266203

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


You might also like:

Related Posts Plugin for WordPress, Blogger...