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. :)

Sep 24, 2010

Infopath Form picking date time from the client machine instead from the SharePoint Server

When using date time in InfoPath Forms, make sure you are aware of the fact that InfoPath 2007 is picking up the date time from the machine on which it's running i.e. clientt machine.

If the usage of the Infopath Forms (i.e. application) is in a single time zone then this might work well until and unless the client machine has the incorrect value set for date time.

Your application at certain time instances won't work properly if you have validations like date time greater then or less then current time and is being accessed by client located in the different time zones around the world.

To mitigate this issue, you need to write code behind in the page load function of infopath form. The code will basically pick the server time and store it with infopath form so that validations can be performed seamlessely regardless of the timezone of the client machine.

Sep 14, 2010

DataView WebPart Sorting Across Pagination Issue



The Sorting in data view web part (when enabling the "basic list toolbar" checkbox in properties using SharePoint Designer) works for the rows which are currently displayed (i.e. displayed on the page)
No need to modify the XSLT.

Sorting will not work across pagination as this is to sort list which has huge amount of data and sorting the entire list might take long time.

Although, If you would like to sort the entire list, please use the toolbar for sorting option in data view properties.


 


Sep 3, 2010

SharePoint Maintenance Page

Three options for the SharePoint Maintenance page based on the available infrastructure:

1)      Using modified ISA custom error page and display custom messages.
          - For internal clients, the files are named Error_number.htm. \
          - For external clients, the files are named Error_numberR.htm (where R indicates reverse).

2)      Display custom message on IIS at Web Front End Server in the SharePoint Farm
         - Create a page "App_Offline.htm" in the Root Site

3)      Route the request from ISA to another Site hosting maintenance page.
         - Maintenace page site on same IIS

Reference: ISA

Jun 20, 2010

Port or Move DataView WebPart from one site or server to another site or server:

Dataview webparts can be developed in development environment and can be ported to a different environment as shown below:


• Edit the WebPart Page > WebPart > Export the Dataview Webpart and save it.


• Import the Data View Webpart on the intended site > webpart page

• The WebPart should display error not the page, i.e. page should render correctly.

• Open the WebPart page using SharePoint designer, go to DataFormWebPart and change the following as shown below:
  or you con modify the .webpart file itself.


Pages