It is pretty simple (and convenient at the same time) to integrate custom code to K2 blackpearl as Endpoints Assemblies.
When you need to manage SharePoint Site Collections using K2 Workflows you have an issue when the K2 Server does not have the SharePoint binaries installed, i.e. you cannot use the SharePoint libraries in a code...
In K2 blackpearl, users can send a task to sleep. This is described in My K2 Worklist Actions – Sleep. Unfortunately, there’s no way to wake sleeping tasks up, neither in K2 Workspace, nor...
If you ever had the situation that “Error Profiles” in K2 Workspace did not show any process instances (obviously in error state) but you know there are some as displayed in “Manage Process Instances”...
Problem Description If you use the following code to retrieve a user’s groups from Active Directory, you could end up in a “COMException was unhandled” exception.
When creating a new user in c# based on a referenced user (which can be done in Active Directory Users and Computers mmc via “copy”), one of the things to do is to copy...
The following code sample creates a new folder on a network share and gives the user full control on the new folder, subfolders and files. Userful for creating user home folders.
static void Main(string args)
private static void createFolder(string share, string folderName)
string newPath = System.IO.Path.Combine(share, folderName);
public static void AddFileSecurity(string folder, string account)
DirectoryInfo dirInfo = new DirectoryInfo(folder);
DirectorySecurity dirSecurity = dirInfo.GetAccessControl();
InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit,
Problems with the PrincipalContext Class when LDAP container not specified (Authentication Problems with PrincipalContext).
Problem Assume the following code to create a new group in SharePoint:
public static void CreateSiteGroup(SPWeb web, string groupName, string PermissionLevel,string groupDescription)
SPGroupCollection groups = web.SiteGroups;
groups.Add(groupName, web.AssociatedOwnerGroup, null, groupDescription);
SPGroup newSPGroup = groups[groupName];
SPRoleDefinition role = web.RoleDefinitions[PermissionLevel];
SPRoleAssignment roleAssignment = new SPRoleAssignment(newSPGroup);
I always got the following exception message in line “SPGroup newSPGroup = groups[groupName];”: Microsoft.SharePoint.SPException: Group cannot be found. But the...