Showing posts with label windows Application. Show all posts
Showing posts with label windows Application. Show all posts

Friday, May 20, 2016

How to Identify Custom Login Page server users

My sharepoint site has also users of Identity server.I want to make custom login page which allow to login active directory



Please refer the below link

http://davidmsterling.blogspot.in/2013/05/setting-up-forms-based-authentication.html

Wednesday, October 14, 2015

How to retrieve User profile Service Properties using Client Object Model In windows Application or Console application

Solution Explorer, right-click on the "References" folder and then click on "Add Reference"

We have to add ddl:
Microsoft.SharePoint.Client.dll
Microsoft.SharePoint.Client.Runtime.dll
Microsoft.SharePoint.Client.UserProfiles.dll

Namespace:

using Microsoft.SharePoint.Client;
using Microsoft.SharePoint.Client.UserProfiles;
Coding:

string siteUserName="nam";
string _siteurl="http://sharepoint.com";
string _sitepassword ="pass@word1";
string accountName ="raghupc\raghu";
ClientContext clientContext = new ClientContext(_siteurl);
clientContext.AuthenticationMode =ClientAuthenticationMode.Default;
clientContext.Credentials = new System.Net.NetworkCredential(_siteUserName, _sitepassword, _domainName);
Web oweb = clientContext.Web;
clientContext.ExecuteQuery();
PeopleManager peopleMang = new PeopleManager(clientContext);
PersonProperties personProp = peopleMang.GetPropertiesFor(accountName);
clientContext.Load(personProp, p => p.AccountName, p => p.Email, p => p.DisplayName);
clientContext.ExecuteQuery();
Label1.Text= personProp.AccountName;
Label2.Text= personProp.Email;
Label3.Text =personProp.DisplayName;