#SharePoint, Solving Open this task problem in Outlook

When you make an Approval Workflow for any document library, the regular scenario is sending the approval details via an email, SharePoint compatible with Outlook adds a button which know as Open this task button, the below image is exactly what you receive when a task assigned to you from the approval workflow:

But unfortunately when clicking this button for completing the task, we have like the below error:

After few searching for this error I have to know the suggested reasons for it:

  1. The form template is not available.
  2. The form template cannot be downloaded from the site.
  3. The form template was not sent in the e-mail message.
  4. The form template was not published to a shared location.

And the suggested resolution is to add the URL for the form template to your trusted sites or local zone and ensure that the person has ‘Contribute’, the minimum permissions required to update InfoPath forms.

But no way L, I have tried all the known solutions without good results, my suggestion to the error is due to cross domain, and LB failures, but the hope is that we have a workaround solution, which also gives more power to the workflow mail actions, as the OWA don’t give you the option of (Open this task) button through web, you must have Outlook.

The Solution is easy, when you make your approval workflow, click on Approval Action to edit it like below:

You will have four options to edit the Action, click change the behavior of a single task like below:

It will give you the detailed steps for the approval process, search for any email sending actions like below:

Then click each one to edit its content, we are going to add the Open task as a link inside the email body, type any text you want for example (Open this task), then click on the Hyper link button in the right corner of the email defining screen like below:

It will open a screen for editing the link, in the Address section click on the String Builder button like below in step (1), then click the Add or Change Lookup button like below in step (2), then in the Data Source section dropdown the list and choose Workflow Context, then in the Field from source section Choose Current Site URL like below in step (3), then O.K to save changes in all windows:


Then the String Builder will be like below, add the following URL snippet behind the added Context (/WorkflowTasks/DispForm.aspx?ID=):
Where (WorkflowTasks) is the name of the current workflow Task list, and (DispForm.aspx) is the display page for the workflow task, and the (ID) is current task ID, which we add this ID , like below steps (2) and (3):

Then O.K to save all changes like before, you will notice like below, that your added text converted to URL, press O.K to finish editing the sending mail action body


Now, repeat the above steps for the remaining email sending actions, and after finishing all, just publish your workflow:

Now test your document workflow, and notice the incoming email to you like below, the link can now open your task form to edit it, approve, reject, cancel, or reassign the task, and also from OWA too, notice that the Open this task button still appear, no way till Microsoft found a solution we can use it later J :

Posted in SharePoint General | 23 Comments

Sign in as a Different User in #SharePoint 2013

In SharePoint 2013 you may notice the missing of Sign in as a Different User in the user info menu, this option was helpful for developers for testing purposes or for technical issues helping other users.

There are many tips for solving this problem:

  • You may first run as different user from the browser options by right click + Shift above the browser short cut.



  • You may try to edit in the Welcome.ascx file to add the command to the user menu like below:

open ” C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\CONTROLTEMPLATES\Welcome.ascx” using notepad, and add the following element before the existing “ID_RequestAccess” element:

<SharePoint:MenuItemTemplate runat=”server” ID=”ID_LoginAsDifferentUser”



MenuGroupId=”100″ Sequence=”100″ UseShortId=”true” />



You can now open your SharePoint site and see the result like below:


  • Another way is to write a custom Web Part and add a Link Button Control and write down the following code for redirecting to different user login:



Now after deploying the solution you can add the web part within your site’s default page



Posted in SharePoint General | Leave a comment

Fixing: “The terminal server has exceeded the maximum number of allowed connections”

In a real development environment you may face the problem of multiple server connection “the terminal server has exceeded the maximum number of allowed connections”, which mean that many users actually have login, some of them are active and others may forgot to logoff before leaving the remote server, there are many solutions to this problem, you may login directly to the server if it was in-place and force disconnecting the inactive users, or use the below solution:

(We are going to create a batch file for wide of use for any server)

Open notepad and add the below lines:



Echo force opening remote site


@SET /P RemoteIP=Please Enter Remote Server IP address:

@SET RemoteIP=%RemoteIP%

mstsc /v:%RemoteIP% /admin




Echo Remote Server IP IS: [ %RemoteIP% ]




Then click File > Save as…. and type the name of the file as “remote Server.bat “, don’t forget to choose from Save as Type in the opened dialogue “All files (*.*)” option.

Now you can see your batch, and you can open it and write down the server IP address, it will open the remote server console, and login using your user as normal, then open the remote server Task Manager, hit the “Users” tab, now you can see who is disconnected and occupy the server, now you can right click and force logging him of.



Posted in SharePoint General | Leave a comment

#SharePoint: Restoring content DB

One of the annoying issues in SharePoint is working with DB problems;

one of these problems is restoring content DB, to solve this problem follow the below steps:

  • First you should take backup normally the way you want
  • If accidently crash happened in DB, try to restore the content DB the normal way
  • You will not be abled because there is error (can’t restore database because it’s in use)
  • My simple solution is to take this DB Offline first from both SharePoint Central Administration, and from SQL Server, then make your normal restoration.

Good luck

Posted in SharePoint General | Leave a comment

Integrating Microsoft #SharePoint Server With Oracle Virtual Directory

In many organizations that are considering deploying Microsoft SharePoint they face a

challenge of needing to leverage identities stored in either multiple Active Directory

servers or identities stored in non-LDAP stores.

Oracle Virtual Directory provides a solution to this challenge.

This is because Oracle Virtual Directory enables organizations to aggregate

identity information without needing to consolidate.

The benefits of Oracle Virtual Directory:

• Provides single point of truth for identity-enabled applications

• Clients can access OVD via LDAP, Web Services and SQL

• OVD can connect to data from a variety of sources including LDAP, relational

databases and Web Services

The benefits of SharePoint and Oracle Virtual Directory Integration are:

• Allow a single SharePoint instance to use multiple Active Directory domains

• Allow SharePoint to use identity information stored in non-Active Directory based

identity stores including databases

• Allow SharePoint to use identity information that is split between Active Directory and

non-Active Directory data stores including databases

Example use cases enabled by Oracle Virtual Directory with SharePoint:

• Allow a SharePoint workspace to be used by two different business units who each

maintain their own AD domain

• Allow users to authenticate to SharePoint with Windows credentials but control access

based on job codes maintained in a HR database

Process Overview

The integration process is very similar to any typical OVD deployment. What this package

provides items that can be used for a typical deployment to reduce the time needed to deploy an

OVD-SharePoint solution.

The process steps are:

• Install SharePoint and Oracle Virtual Directory

• Configure OVD to connect to identity stores

• Configure SharePoint’s LDAP provider to connect to OVD

OVD Configuration

• Create a Local Store Adapter (LSA) to store the static base tree value (for example


• Populate the LSA with the static entry data

• Add adapters with ROOT values configured to be branches under the base tree (such as


• For any AD LDAP adapters — add the ObjectClass mapper plug-in and map the cn attribute

to the samaccountname attribute. This is because SharePoint will attempt to lookup the

username in the cn attribute instead of the AD standard samaccountname attribute.

• If using OVD to connect SharePoint to OID – the Proxied Page Size parameter needs to be

set to 10.

Microsoft SharePoint Configuration

The integration with Oracle Virtual Directory requires a version of SharePoint that works with

the SharePoint LDAP Membership provider. This provider is developed and supported by


Create a new zone in SharePoint for the web application (portal) that’s is going to use OVD.

Use the option “Extend an existing Web Application”

• Change the authentication method for the application and choose Forms Authentication

(Applications->Authentication Providers->New Zone). Make sure you use

LdapMembership for Membership Provider and LdapRole for Role Management. These

are the names used in the web.config below.

• Modify the web.config file for the web application in the new zone and also for the Central

Administration site. Add the following entries:

• Between the key <PeoplePickerWildcards> on both files



<add key=”LdapMembership” value=”*” />

<add key=”LdapRole” value=”*” />



• Between the key <system.web> on the Web Application web.config. Replace OVDHOST,


Restart the Application


<membership defaultProvider=”LdapMembership”>


<add server=”OVDHOST” port=”OVDPORT” useSSL=”false”

userDNAttribute=”distinguishedName” userNameAttribute=”cn”

userContainer=”USERSEARCHBASE” userObjectClass=”person”

userFilter=”(ObjectClass=person)” scope=”Subtree”

otherRequiredUserAttributes=”sn,givenname,cn” name=”LdapMembership”

type=”Microsoft.Office.Server.Security.LDAPMembershipProvider, Microsoft.Office.Server,

Version=, Culture=neutral, PublicKeyToken=71E9BCE111E9429C” />



<roleManager defaultProvider=”LdapRole” enabled=”true” cacheRolesInCookie=”false”



<add name=”LdapRole” type=”Microsoft.Office.Server.Security.LDAPRoleProvider,

Microsoft.Office.Server, Version=, Culture=neutral,

PublicKeyToken=71E9BCE111E9429C” server=”OVDHOST” port=”OVDPORT” useSSL=”false”

groupContainer=”GROUPSEARCHBASE” groupNameAttribute=”cn”

groupMemberAttribute=”Member” userNameAttribute=”cn” dnAttribute=”distinguishedname”

groupFilter=”(ObjectClass=group)” scope=”Subtree” />




• Restart the Applications (iisreset)

• Assign a new administrator to the new App/Zone. (Application Management->Policy for

Web Applications->Choose app and new zone). Choose a user as the admin. Users should

show up as {ldapmembership:user id}. If users or groups can’t be searched something is bad

in the web.config file.

• Try to login to the Web App in the new zone, it should ask for credentials with a Form.

• Permissions can be added to users and groups in SharePoint as normally.

Posted in SharePoint General | 1 Comment

RSS Feeds For #SharePoint Site using CQWP

One of the amazing features of using Content Query Web Part (CQWP) is feeding, I have faced an unknown problem with RSS service in my SharePoint 2007 site, though the service was activated within the Central Administration, it couldn’t be found in my web application, i have searched a lot till i found a suggestion of using CQWP to preview the feeds for specific site, here you are the link i found:


and BTW it’s applicable for both SharePoint 2007 & 2010 too.

Posted in SharePoint General | Leave a comment

#SharePoint 2010 Installation failure “Couldn’t find file c:\Windows\System32\drivers\etc\hosts”

Sometimes while you are removing SharePoint 2010 server from your machine and re-install it  , and run the SharePoint 2010 products configuration wizard in the 4th step you may face ,this error “Couldn’t find file c:\Windows\System32\drivers\etc\hosts” or even couldn’t access it, the reason i think is that “hosts” file which path is in “c:\Windows\System32\drivers\etc\” may be deleted or modified, during removing your SharePoint installation by the SharePoint timer service, So     what we shall do is re-creating this file again?

i’m not going to discuss the function of this file you can found it by “Google” it :).

step-1: go to the following path:”c:\Windows\System32\drivers\etc\”, and create a new text file, and insert the following text inside it:

# Copyright (c) 1993-2008 Microsoft Corp.
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
# For example:
#     rhino.acme.com          # source server
#     x.acme.com              # x client host       localhost

This is a typical content though the only important part is this line ”   localhost”.

step-2 Save this file as hosts but remove the .txt extension

Now the last step is  to apply appropriate permissions for WSS_Admin_WPG to it.  If you don’t, you are just going to encounter another error (This time a permission error: Access to the path ‘C:\WINDOWS\system32\drivers\etc\HOSTS’ is denied). 

To do so, just right click the hosts file and select properties then,  security tab, then edit, then Add..,then  type WSS_Admin_WPG and click check names and ok, don’t forget to allow modify option like below:

Now re-run the SharePoint 2010 products configuration wizard again and i hope that your installation successfully complete .

Posted in SharePoint General | 2 Comments