Thursday, 25 October 2012

how to differentiate AD Users & Groups from Sharepoint people picker programmatically ?

Add Reference from .NET tab or Browse the following location & add the dll.

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\

using Microsoft.Office.Workflow.Utility;

Contact c = Contact.FromName("Server Name\\Group Name", Myweb);
if (c != null)
string strUserType = c.PrincipalType.ToString();

The above PrincipalType return SecurityGroup or Users.

No comments:

Post a Comment