Wednesday 30 May 2012

SP2010 Logging Summary

Overview: ULS & Logging can be confusing for SharePoint.  It's really pretty simple and this post aims to clarify the basics of error logging on SP2010 farms.

Tip: Usage records analytics (referred to as Web Analytics).  Usage and ULS logs as well as other metrics and the event log are put into the Reporting database that is configured in "CA" under "monitoring" for "Configure Usage and health data collection".  This post only looks at ULS.

Summary:
  1. Each event in SharePoint is given a unique correlationId, this is a unique identifier to help pull out the appropriate log entries from the ULS. 
  2. ULS create .log files that can be opened individually using notepad.
  3. ULSViewer is useful for examining multiple log files at once.  There are a few products that do the same thing but I use the Microsoft ULSViewer.
  4. The amount of information logged by the ULS can be set in CA or using PS (see image 1 below).
  5. If you enable timer jobs ("Diagnostic Data Provider: xxx" * 7), the data is shipped from the ULS logs on each server into the SP Logging DB.  Useful as it provides a central view and you can backup/achieve the data.  The Timer jobs pull in data from ULS, EventViewer, Timer Jobs and various other performance indicators.
Image 1.  Amending the default logging settings using PowerShell  (Can also use CA)

  
More Info:
Setting Logging levels: http://technet.microsoft.com/en-us/library/ff607887
Debugging & Logging: http://msdn.microsoft.com/en-us/library/gg512103.aspx
Logging explained by Waldek: http://blog.mastykarz.nl/logging-uls-sharepoint-2010/
ULS Explained: http://community.bamboosolutions.com/blogs/sharepoint-2010/archive/2011/07/07/sharepoint-2010-cookbook-the-usage-of-sharepoint-2010-uls-logging.aspx
ULS Viewer by Spencer Harbar: http://www.harbar.net/archive/2010/10/06/ulsviewer-ndash-the-tool-that-no-sharepoint-practitioner-should-be.aspx

Monday 28 May 2012

PS for Office 365

http://onlinehelp.microsoft.com/office365-enterprises/hh124998.aspx
http://technet.microsoft.com/en-us/magazine/hh750396.aspx
http://blog.powershell.no/2011/05/09/administering-microsoft-office-365-using-windows-powershell/

Rene Modery gave me some useful information on Office 365 namely you can manage Exchange Online but not SPO using remote PS. 

You can also use PS to manage information around accounts for Office365 which in effect is used by SPO.

Friday 25 May 2012

SP2010 April 2012 CU warning

Problem:  I waited 3 weeks after the SP2010 April 2012 CU was release to install on my dev VM thinking it must be safe.  Installed and ran psconfig to discover my User Profile Service (UPS) is not working.

Initial Hypothesis:  As I can't fix the UPS using the UPS rational guide or the MS UPS post I rolled back and reapplied the April patch UPS is working.  I guess this must be a corner test issue but regardless I can't replicate te problem. 

Resolution: MS have pulled the April CU, this has happened twice before with other CU releases since SP1 and subsequently an update April 2012 CU binary patch is probably going to be re-released.  So for now stay off the April 2012 SharePoint 2010 CU as of 28 May 2012.  If you want to patch use the February 2012 CU (providing you need it).

Other:
June 2012 CU for SP2010 is the latest patch as of 03 July 2012.

Also see:
Patch Sp2010 farms

Wednesday 23 May 2012

Retrieving Claims Values in SP2010

Problem:  Developer wants to retrieve values from the users claim to send an email.

Intial Hypothesis:  Create a web part to demonstrate the code that displays all the claim values.  Pull out the claim values such as the UPN in my case and send an email to the current user based on the upn value.  The upn in my dev machine is the users email address but it obviously depends on how you claims are setup.

Resolution:  Create a new SharePoint project and add a web part.  Then add the code as shown below.
Updated 28 May 2012 - Format of claims post
Example from ADFS2.0 connecting to AD:  "i:0ǽ.t|mkting|testuser"

User Information List

To see a site collection's hidden user information list append /_catalogs/users/simple.aspx onto the end of the site collection url.
Example:
http://claims.demo.dev/_catalogs/users/simple.aspx

How User InfoWorks?
When a user is given permission to the site collection or the 1st time the user log in, their credentials/user info gets added to the UserInfo list.  The UserInfo user data does not get added to the list when a user is added via AD groups; only when the AD added end user logs into the site collection for the 1st time do they get an entry in the list.
Note: The UserInfo list entry is not added if you pick the user in a list within a people picker column.

For the display of a specific user: _layouts/15/userdisp.aspx?ID=25&Force=True

I get the users Id in the UI by appending this to the URL: /_layouts/15/people.aspx?MembershipGroupId=0 
I then find the user and find their Id and use this URL in the browser to see the user info:
/_layouts/userdisp.aspx?id={UserID}&Force=True

Thursday 17 May 2012

Timer Job Paused

Problem:  One of our environments was not running timer jobs and had 17 timer jobs in a status of "paused".
Initial Hypothesis: I replicated the pause timer jobs on a dev machine.  I removed the cache and the paused jobs were still present.  Performing a PSConfig fixed the timer job issue but broke my User Profile Service (UPS).  So not a viable fix.
Resolution: One of the engineers worked out that another engineer had played with the OWSTIMER.EXE configuration had been changed and once corrected, the time jobs flushed themselves out.

Wednesday 16 May 2012

User Profile Service Sync Setup

Overview:  This post assumes UPS is setup and work and merely shows how to amend the synchronisation of AD with the User Profile Service (UPS).










Verify the Synchronisation has run:




Sources/More Info:

http://www.harbar.net/archive/2011/07/12/332.aspx
http://www.harbar.net/archive/2011/02/10/account-deletion-and-sharepoint-2010-user-profile-synchronization.aspx