Translate

Monday, July 4, 2016

Get ULS Log Using Powershell

How to get the ULS log entries using powershell

It is not easy to search for an error using correlation id from the sharepoint log. We use ULS log viewer to make the ULS log look nicer. However, powershell provides us a way to extract the log between a specified time frame and provide a text file. Run the below command to get it.

Add-PSSnapin Microsoft.SharePoint.PowerShell
Get-SPLogEvent -StartTime "07/02/2016 11:35:00" -EndTime "07/02/2016 11:40:00" | ?{$_.Correlation -eq "3c768c9d-5f2e-70a4-962e-b5dddb8ca4f2"} | select Area, Category, Level, EventID, Message | Format-List | out-file "D:\Corelog.txt" 

Monday, May 30, 2016

SharePoint 2013 Server - The status code of response is '500'. The status text of response is 'System.ServiceModel.ServiceActivationException'.




SharePoint 2013 Server - Unexpected response from server. The status code of response is '500'. The status text of response is 'System.ServiceModel.ServiceActivationException'


When everything is working fine and suddenly you start receiving an error while the SharePoint page loads, "Unexpected response from server. The status code of response is '500'. The status text of response is 'System.ServiceModel.ServiceActivationException'". That too from only one front end server. First thing first;

  • Remove the front end server from the load balancer.
  • Now your site is fine for end users, but not for you ;)
  • Login to the front end server where the issue is occurring.
  • The issue occurs mostly because of occupied memory. If memory utilization is more then you will receive this error.
  • Right click on Task manager and check the memory occupied.
  • The users who are logged into the servers and forgot to log off has occupied space.
  • Right click on the username and force log off them; except your userid ;)
  • Refresh the SharePoint site, the error is no more.
  • Enable the server in the load balancer again.

Cheers !