Monday, February 14, 2011

What is a distribution group? Why it throws HTTP status 401: Unauthorized Error in Sharepoint

What is a distribution group?
Distribution group is a sharepoint goup which is used for distributing emails to more than one people. whenevenr we want to relay a email message for a group, than we need a distribution group. It need a email id for distribution group, and when we creates a distribution group in sharepoint than automatically a AD group is created.
In MOSS 2007, AD's Distribution group can not be added into people & groups. So MOSS 2007 has added this feature to link AD's DIstribution group with SP. Now you can create a distribution group in Sharepoint and it will creates group in AD.
There are three different places you can find for disribution group in sharepoint:
1. Central Admin (Central Administration > Operations > Incoming E-Mail Settings )
Configure Incoming E-Mail Settings
Set Enable sites on this server to receive e-mail? Yes, and Settings mode: Advanced
Incoming E-Mail Server Display Address

2. under Central adminitrator > Topology and Services, click on Approve/reject distribution groups. it will show view for approved distribution group.
create a new view for ViewAll and don't put any filter. ViewAll will show all the Dtribution groups. based on their status select group which is in pending stage. right click and click on approve.

3.go to people & users and go to groups & select a group. once group is selected than go to settings > group settings. In "E-Mail Distribution List" section, select yes for Create an e-mail distribution group for this group? , and then give the name for group. Click OK.

4.Create document library/list to recieve a incoming email - Create new document library/list. while creating the new list/lib a. select Allow this document library to receive e-mail? Yes, b. Type the email address under Incoming E-Mail section.

If you don't have proper securty at AD for sharepoint account than you will get these errors:

In Central Admin
Object reference not set to an instance of an object. at Microsoft.SharePoint.EmailIntegration.SPEWSApprovalManager.ExecuteJobInAD(Int32 listItemID)
at Microsoft.SharePoint.ApplicationPages.DMSCmdPage.BtnOk_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Troubleshoot issues with Windows SharePoint Services.

While Change Group Settings (people & group > groups > select your group > settings > group settings)

The request failed with HTTP status 401: Unauthorized. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at Microsoft.SharePoint.DirectorySoap.SPDirectoryManagementProxy.CreateDistributionGroup(String Alias, String Name, String Description, String ContactCN, RequestInfo Info, DistributionGroupFlags Flags)
at Microsoft.SharePoint.SPGroup.CreateDMS(String dlAlias, String friendlyName, String description, String[] members, String requestor, String justification, Int32& jobId)

Setup groups
Distribution group could not be updated because of the following error: The following error has occurred while attempting to contact the Directory Management Service: The request failed with HTTP status 401: Unauthorized.

I will keep posting with my findings.

Enjoy Green coding at

Hussain Naqvi