Top Banner
Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director
23

Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

Mar 30, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

Leveraging User Profiles and My Sitesin SharePoint 2010 and 2013

Beatrice Baciu - ArchitectDerek Cash-Peterson - Practice Director

Page 2: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

http://thebookofsharepoint.blogspot.com/ @BeatriceBaciu

@spdcp http://spdcp.com

Page 3: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

The Challenge

Centralize all profile data

Searching profile data

Integrate with other systems of record

Page 4: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

Agenda

• How does the user profile service work?

• The benefits of the user profile service.

• How does the user profile relate to MySites?

• Configuring user profile service

• Ways to develop against the user profile service in 2010 & 2013

Page 5: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

What We Are Not Talking About

• Enterprise Social

• Tagging/Notes

• Basic configuration of User Profile Service

Page 6: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

How Does the User Profile Service Work

SharePoint

User ProfileService

Application

FIM

C#

Direct Active Directory Import

BCS

External System

?

Active Directory

Page 7: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

Benefits of the User Profile Service

• Allows centralized location for all user properties

• Aggregation of user properties regardless of source

• Out-of-the-box storage of links to user mysites

• Individual MySite provides indivudal location to manage and store documents, links, etc.

• Easy consumption of data in code

Page 8: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

How does the user profile relate to MySites

• There is a link to the users MySite in the User Profile

• MySite provides user with an interface to edit profile data

• MySite Provides an individual repository for users that is security trimmed

• Aggregation of all user profile properties in one source

Page 9: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

User Profile Service Demo Configuration with ADFS and a custom database

Page 10: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.
Page 11: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

Recap

• Use AD/ADFS as primary sync connection

• Use BCS to import additional profile properties

• Use property mapping to aggregate the User Profile

• If using SPD, the primary key will be used as the identifier; modify the BDCM file yourself and use a unique logical key

• Permissions in BDC

Page 12: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

Troubleshooting

• Connections Disappear: consider restarting the User Profile Synchronization Service

• Random Sync issues: consider restarting the SharePoint Timer Service

• when MySite gets created, user profile gets created if not there

Page 13: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

Limitations

• BDC cannot be the primary sync connection

• Duplicate profiles

• Once sync connection is deleted, profiles need to be purged via PS

Page 14: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

User Profile Service in Farm-level scenario

Page 15: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

Design Approach

Page 16: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

Coding with the User Profile Service in SharePoint 2010

Page 17: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

Coding with the User Profile Service in SharePoint 2013

Page 18: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

User Profile Service Data Access via REST

• GET• All current user properties

http://siteurl/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='domain\username

• Get specific property of current userhttp://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties?$select=PictureUrl,AccountName

• Get all properties for a specific userhttp://siteurl/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='domain\username’

• Get specific property for a specific userhttp://siteurl/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,propertyName='LastName')?@v='domain\username‘

Page 19: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

User Profile Service Data Access via REST

• POST• Provision user MySite

http://siteurl/_api/SP.UserProfiles.ProfileLoader.GetProfileLoader/GetUserProfile/CreatePersonalSiteEnqueue

• Set current user’s profile picturehttp://siteurl/_api/SP.UserProfiles.PeopleManager/SetMyProfilePicture

• NOTES• Changing user’s profile properties is not implemented in REST or CSOM• Deletion of user profiles is not implemented in REST or CSOM• o365 authentication uses account names like @v='i:0%23.f|membership|

[email protected]

Page 20: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

User Profile Service Data Access via RESTvar inputParameters = {

“props”: {

"__metadata": { "type": "SP.UserProfiles. GetUserProfilePropertyFor" }, "accountName": "demo\bbaciu","propertyName": [“FirstName”]

}}; var requestHeaders = {

"Accept": "application/json;odata=verbose","X-RequestDigest": jQuery("#__REQUESTDIGEST").val()};

jQuery.ajax({

url:_spPageContextInfo.webAbsoluteUrl + "/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor",

type:"POST",data: JSON.stringify(inputParameters ),contentType : "application/json;odata=verbose",headers: requestHeaders,success:function(data){

//read property},error:function(jqxr,errorCode,errorThrown){

//handle error}

});

Page 21: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

User Profile Service Data Access via CSOMSP.SOD.executeOrDelayUntilScriptLoaded(getUserProperties, 'SP.UserProfiles.js');

function getUserProperties() {

var targetUser = "domainName\\username”;

var clientContext = new SP.ClientContext.get_current(); var peopleManager = new SP.UserProfiles.PeopleManager(clientContext); personProperties = peopleManager.getPropertiesFor(targetUser); clientContext.load(personProperties);clientContext.executeQueryAsync(onRequestSuccess, onRequestFail);

} function onRequestSuccess()

{//we distinguish between user properties and user profile propertiesvar messageText = " \"DisplayName\" property is " + personProperties.get_displayName(); messageText += "<br />\"Department\" property is " + personProperties.get_userProfileProperties()['Department'];

}

Page 22: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

Recap

• How the user profile service works.

• The benefits of the user profile service.

• How does the user profile relate to MySites?

• Configuring user profile service

• Ways to develop against the user profile service in 2010 & 2013

Page 23: Leveraging User Profiles and My Sites in SharePoint 2010 and 2013 Beatrice Baciu - Architect Derek Cash-Peterson - Practice Director.

Beatrice Baciu@BeatriceBaciuhttp://thebookofsharepoint.blogspot.com/

Derek Cash-Peterson@spdcphttp://www.spdcp.com

BlueMetal Architects

www.bluemetal.com

Blog.bluemetal.com

@bluemetalinc

Thank You!