Skip to main content

Posts

Showing posts from July, 2019

Read all the SharePoint User profile field using CSOM

The article shows CSOM and C# code to read all the user profile field. create a console application and copy the code below and replace the siteurl, user id and password with your sharepointURL , user id and password.

You need to add three dll to run this code:-
Microsoft.SharePoint.Client
Microsoft.SharePoint.Client.Runtime
Microsoft.SharePoint.Client.UserProfiles

Add this dll and run the code. Enjoy Coding.



using System;
using Microsoft.SharePoint.Client;
using Microsoft.SharePoint.Client.UserProfiles;
using System.Security;
namespace ConsoleApp1
{
    class Program
    {
        static void Main()
        {
            using (ClientContext clientContext = new ClientContext(Yoursiteurl))
            {
                string UName = "Your user name";
                string Upassword = "Password";

                SecureString SecurePassword = GetSecureString(Upassword);
                clientContext.Credentials = new SharePointOnlineCredentials(UName, SecurePasswo…

SharePoint user profile fields with their internal name.

We can update the SharePoint user profile fields manually or programmatically. Also using power shell, we can update the user profile fields. For updating the SharePoint user profile field need to enable the Allow users to edit values for this property, SharePoint Admin can enable this property.
Display Name Actual NameType
IdUserProfile_GUIDUnique IdentifierSIDSIDbinaryActive Directory IdADGuidbinaryAccount nameAccountNamePersonFirst nameFirstNamestring single valuePhonetic First NameSPS-PhoneticFirstNamestring single value Last nameLastNamestring single valuePhonetic Last NameSPS-PhoneticLastNamestring single valueNamePreferredNamestring single valuePhonetic Display NameSPS-PhoneticDisplayNamestring single valueTitleTitlestring single valueManagerManagerPerson PicturePictureURLURLData sourceSPS-DataSourcestring single valueAbout MeAboutMeHTMLDepartmentDepartment‪string (Single Value)‬DepartmentSPS-Department‪string (Single Value)‬Quick linksQuickLinks‪string (Single Value)‬Web siteWe…