I am trying to get all users by group name and dispalay it in sharepoint webpart. adGroupName something like = \"CompanyGroup\".
GroupPrincipal grp = GroupPr
Answer was found in blog:
http://sharepoint-tweaking.blogspot.com/2007/12/impersonation-in-aspnet-causes.html
Solution is to use code:
using (HostingEnvironment.Impersonate()) { // This code runs as the application pool user DirectorySearcher searcher ... }