Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Microsoft.SharePoint.SPException: Group cannot be found." is logged but the message is sent to

  Asked By: Tara    Date: Nov 20    Category: Sharepoint    Views: 9283

hope that someone can help. I have a workflow created in SharePoint
Designer. At the end of the workflow an e-mail is sent. The source of
the "To" field is a lookup on a text field in the current item. The CC
field is is SharePoint group. When the workflow is executed by any
person in a particular group, it stops at the e-mail step and logs "The
user does not exist or is not unique." A second error appears shortly
after "The following error was thrown while looking up the group,
xxx@... <mailto:xxx%40mail.com> : Microsoft.SharePoint.SPException:
Group cannot be found."
and the e-mail address is the value that the workflow gathered from the
aforementioned text field in the current item.

I've confirmed that if I run the workflow the error "The following error
was thrown while looking up the group, xxx@...
<mailto:xxx%40mail.com> :
Microsoft.SharePoint.SPException: Group cannot be found." is logged but
the message is sent to the correct people. The error "The user does not
exist or is not unique." is not logged when I run the workflow. I've
compared permissions on all lists and they are identical between the two
accounts.

Does anyone know what could cause this issue?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Lesley Tate     Answered On: Nov 20

After banging my head against the wall all day long I finally figured
out the problem. The user  that could complete the workflow  was a site
administrator, the user that couldn't was not (we'll call him USERA).
USERA did not have permissions  to view the members in the group  listed
in the CC field. The solution was to set OnlyAllowMembersViewMembership
to false on every group. I used the following console application to set
it on every group. If you use the code below make sure to update it with
your information.

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using Microsoft.SharePoint;

using System.IO;

namespace GroupMembersAudit

{

class Program

{

static void Main(string[] args)

{

LogEntry("Connecting to site");

using (SPSite mySite = new SPSite("http://SHAREPOINTSITE/"))

{

LogEntry("Connected, connecting to web.");

using (SPWeb myWeb = mySite.OpenWeb("SUBSITE"))

{

foreach (SPGroup group in myWeb.Groups)

{

LogEntry("Group = " + group.Name);

LogEntry("Original
OnlyAllowMembersViewMembership: " +
group.OnlyAllowMembersViewMembership.ToString());

group.OnlyAllowMembersViewMembership = false;

group.Update();

LogEntry("Modified
OnlyAllowMembersViewMembership: " +
group.OnlyAllowMembersViewMembership.ToString());

}

if (myWeb != null)

{

myWeb.Dispose();

}

}

if (mySite != null)

{

mySite.Dispose();

}

}

}

private static void LogEntry(string logText)

{

string logTextWithDate = DateTime.Now.ToString() + ": " +
logText;

Console.WriteLine(logTextWithDate);

StreamWriter logWriter = new
StreamWriter(@"C:\Temp\GroupMembersAudit.txt", true);

logWriter.WriteLine(logTextWithDate);

logWriter.Flush();

logWriter.Close();

logWriter.Dispose();

}

}

}