Skip to main content

Posts

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…
Recent posts

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…

how to create and delete folder using C#.

We can create, delete of check folder in c# using the Directory class. To create folder set the path(Location) on which you want to create the folder into  the variable, Here i am taking variable named folderPath. 
1. To create folder/directory.
string folderPath="E:\testing\";
  if (!Directory.Exists(folderPath))           {             Directory.CreateDirectory(folderPath);           }
2. To delete folder/directory. This method used when the folder you want to delete is empty.
string folderPath="E:\testing\test";
if (Directory.Exists(folderPath))             {                 Directory.Delete(folderPath);             }
3. To delete folder/directory with all the content.
string folderPath="E:\testing\test";
if (Directory.Exists(folderPath))             {                 Directory.Delete(folderPath,true);             }


Thanks!!!

Why to choose SharePoint?

SharePoint is a collaboration tool which mainly used for document sharing, managing, controlling and storing them in its starting days. Sharepoint improving day by day and now its became very handy tools for the organization to work as a team. Organizations use the SharePoint as per their requirements.

In Many ways, Organizations can use the SharePoint like:

1 Document Sharing and storage system.
2 It can be used as a collaboration tool.
3 As an Intranet system.

SharePoint is very flexible and secure system. Its give the flexibility to develop custom solutions to fulfill the requirement.

Reasons to choose SharePoint as an intranet system for your organizations.

Flexibility : 

SharePoint is very flexible and provide the functionality to develop and deploy custom solutions on SharePoint. one can also use the third party add-ins to fulfill their needs.

Security:

Sharepoint provides inbuilt security system which persists own permission levels. you can give permission to a particular user on…

Shortcut keys which every windows user must know.

Shortcut keys play important role if we want to use the windows effectively.



Window Key = Open or close start menu.Windows + E   =  Open the file explore.Windows + D   = Show or hide the desktop.F11 = Minimize or Maximize the active window.Windows + S = Open searchWindows + L = Lock the system .Window + R = Open the run dialog box.Windows + Tab = Open the task view.Windows + Space Bar = Switch input and language keyboard.Windows + Plus(+) = Open magnifier(To zoom in or zoom out).   Windows + A = Open Action center.Windows + T =  Move through the apps on taskbar.

Insert operation with Sharepoint List using CSOM.

To insert item into list using csom code. You can create a consol application using visual studio and also use the code mentioned below. You can interact  with sharepoint list using JSOM,CSOM or using rest api.
List operation using csom.

using Microsoft.SharePoint.Client;  using System;  using System.Collections.Generic;  using System.Linq;  using System.Security;  using System.Text;  using System.Threading.Tasks;  namespace ConsoleApp1 {
class Program {
static void Main(string[] args)
{
using (ClientContext clientContext = new ClientContext("insert url upto list"))
{
string Uname = "Your ID";
string password = "Password";  SecureString Securepasseord = GetSecureString(password);  clientContext.Credentials = new SharePointOnlineCredentials(Uname, Securepasseord); clientContext.ExecuteQuery(); List oList = clientContext.Web.Lists.GetByTitle("metalist");  ListItemCreationInformation listCreationInformation = new ListItemCreationInformation…