Oct 14, 2010

Does the Current or Logged in SharePoint User belongs to a certain Distribution Group of the Active Directory

Use the following to determine if the Logged in SharePoint User belongs to a certain Distribution Group of the Active Directory :

Page.User.IsInRole("domain//groupname")

Since the SharePoint site runs on IIS. We can call Page.User.IsInRole("domain\groupname") to determine if the user is a member of the Active Directory group.

NOTE: For C#, use two backslashes instead of just one.


Understanding the difference between distibution List and Security Group is important.

In Microsoft Active Directory, what are security and distribution groups?

In Microsoft Active Directory, when you create a new group, you must select a group type.
The two group types, security and distribution, are described below:

Security: Security groups allow you to manage user and computer access to shared resources. You can also control who receives group policy settings. This simplifies administration by allowing you to set permissions once on multiple computers, then to change the membership of the group as your needs change. The change in group membership automatically takes effect everywhere. You can also use these groups as email distribution lists.
Distribution: Distribution groups are intended to be used solely as email distribution lists. These lists are for use with email applications such as Microsoft Exchange or Outlook. You can add and remove contacts from the list so that they will or will not receive email sent to the distribution group. You can't use distribution groups to assign permissions on any objects, and you can't use them to filter group policy settings.
Refrence: Active Directory

BTW, Admin of AD should create a Security Group not just the distribution list. :)

No comments:

Pages