Showing posts with label SharePoint. Show all posts
Showing posts with label SharePoint. Show all posts

Friday, 7 December 2012

Error Value: 2147942523 on Scheduled Task for Powershell


Situation: 
One of our clients where struggling with SSRS2008 R2 in SharePoint 2010 integrated mode (two server farm, both 64-bit Windows 2008 R2).
It is well known that this version SSRS 2008 R2 (v10) delivers a really bad performing webpart on the first report that is requested at the beginning of the day. For your information: The older v9 version performs much better as well as the newer version (of SSRS 2012).
However, I tried several solutions, without any luck. I found a solution on Pavel Pawlowski's blog (http://www.pawlowski.cz/2011/07/solving-issue-long-starting-report-ssrs-2008), which suggest to run a powershell script to stop/start the SSRS service, and load a report in a webclient (read more details on his post).
Problem:
I tried to run the scheduled task with the following statement:
"powershell.exe -noprofile -executionpolicy RemoteSigned -file c:\dnm\RestartSSRS.ps1"
It didn't work, it shows the following errors:
Task category: Action failed to start
Description: Task Scheduler failed to launch action “powershell.exe -noprofile -executionpolicy RemoteSigned -file c:\dnm\RestartSSRS.ps1? in instance “{46caf0b2-50df-49ad-90d6-0f4f9fd203ae}” of task “\SSRS Recycle”. Additional Data: Error Value: 2147942523.
Then I get:
Task category: Action start failed
Description: Task Scheduler failed to start instance “{46caf0b2-50df-49ad-90d6-0f4f9fd203ae}” of “\SSRS Recycle” task for user “customerdomain\Administrator” . Additional Data: Error Value: 2147942523
Solution:
I turns out that in this situation the Task Scheduler cannot fire the 64-bit version of powershell (which powershell.exe will do). You need to explicit point to the 32-bit version.
What I did was, edit the scheduled task, go to the action-tab and open the edit action window of the action.
On 'Program/script', I entered: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
On 'Add arguments (optional), I entered: -noprofile -executionpolicy RemoteSigned -file c:\myScripts\RestartSSRS.ps1

Done, that solved the "Error Value: 2147942523" problem for me.
And the solution Pavel Pawlowski gave, works also! All credits to him!

Tuesday, 16 October 2012

LINQ to SharePoint: linq query filter on multivalue lookup

Situation:
I have a SharePoint Foundation 2010 environment with a document library. One of the metadata on the documents is a multivalue lookup to a category list.
I used SPMetal to create entity classes for easy usage of linq to the different lists and libraries inside the SharePoint site.
Problem:
Inside a visual web part, I was trying to execute a linq query on the document library, filtering on a given category.
Example code:

QualityDataContext dc = new QualityDataContext(SPContext.Current.Web.Url);
// some other steps made
var mySelectedCat = dc.MyCategories.OrderBy(p => p.Title).Where(p => p.id == "CategoryOfInterestID")

var docs = dc.MyDocLib.OrderBy(p => p.Title).Where(p => p.Categories.Contains(mySelectedCat));

This goes wrong because in this situation linq is messing up with the "p.Categories" en the entity "mySelectedCat"

Solution:
I have searched a lot, without getting a right, easy solution. Some mentioned to use the 'old' "SPWeb, SPList, SPQuery and so on"-way. Others where trying to believe you that the sample above is working.
Sorry folks, it's not. The problem is that querying on the multivalue lookup just works after the data has been retrieved. So I uses the ToList() method to the 'docs' part, just before filtering. For performance reasons, I first get the whole list (I just needed the whole list) and then do the filtering on the moment I needed it.
So this results in the following piece of code that I am using to fill a tree view, grouped on main category and sub category with links to documents.
Note the 'ToList()' I am using, twice just straight in the beginning of the using section. This is doing the trick.

using (QualityDataContext dc = new QualityDataContext(SPContext.Current.Web.Url))
{
 var cats = dc.MyCategories.OrderBy(p => p.Title).ToList();
 var docs = dc.MyDocuments.OrderBy(p => p.Title).ToList();

 SPTreeView tv = new SPTreeView();

 var mainCat = cats.OrderBy(p => p.Category).GroupBy(p => p.Category);
 
 // Step through the main categories
 foreach (var item in mainCat)
 {
  TreeNode catNode = new TreeNode{ Text = item.Key, Value = item.Key };
  
  var subCats = cats.OrderBy(p => p.Title).Where(p => p.Category == item.Key);

  // Step through the sub categories
  foreach (var subCat in subCats)
  {
   TreeNode subCatnode = new TreeNode { Text = subCat.Title, Value = subCat.Id.ToString() };
   var subdocs = docs.Where(p => p.Categories.Contains(subCat));

   if (subdocs.Count() > 0)
   {
    foreach (var doc in subdocs)
    {
     string docUrl = doc.Path + "/" + doc.Naam;
     subCatnode.ChildNodes.Add(new TreeNode { Text = doc.Naam, ToolTip = doc.Title, NavigateUrl = docUrl, Target = "_blank" });
    }
    subCatnode.Collapse();
    catNode.ChildNodes.Add(subCatnode);
   }
  }
  tv.Nodes.Add(catNode);
 }
 this.Controls.Add(tv);

Tuesday, 21 August 2012

Attachments in SharePoint List Item ARE searchable

Today I got a question by phone of one this blog-followers (hi Erwin!). His question was if attachments on SharePoint list items are searchable. I had to confess that I've never had this question before. A first quick search on the internet gave the answer: no!
But, that isn't the truth. I just search a bit around, because I was curious if that was really true. I found that list attachments are indexed in SharePoint search. And because of that, searchable!
The trick, or if you like the problem, is the presentation of the results by SharePoint. The results are not pointing to the attachment itself, but to the list item that contains that attachment. But in the description of the search result, you can see the words from the attachment that you searched for. This is a bit disappointing because the search result would be confusing and useless if the list item has multiple attachments. The user won’t know which attachment contains the words he searched for.
(thanks to Saji Viswambharan)

Tuesday, 7 August 2012

SharePoint designer workflow not updated

Today, I ran into another big SharePoint mystery (if you like mysteries, join the SharePoint world ;) ). A couple of weeks ago, I wrote a workflow in SharePoint designer (SPD) on a SharePoint Foundation environment. So far, so good.
Problem:
Today, I had to update/fix the workflow because I forgot a little step. And guess what, it didn't work. The updates on the workflow were not applied. Although a new version of the workflow was present on the site, the changed were not. Rebooting the entire SharePoint machine didn't solve this. Arghhhhhh..... But lucky me, after some search, I noticed that I was not the only one...
Solution:
It seems that SPD (sometimes = randomly I guess) forgot to empty his own application cache. A republish of a workflow is then done with the cached (=old) info. This is due to a mismatch between the server's activity and the SPD client's cached activity. So:
  1. Close SPD.
  2. Open “My Computer”.
  3. Go to %System Drive%\Documents and Settings\%user%\Local Settings\Application Data\Microsoft\WebSiteCache (If you are running Vista, that path is different - look for %System Drive%\Users\%user%\AppData\Local\Microsoft\WebSiteCache).
  4. Go to a directory that looks similar to the name of the website you were connecting to. (Alternatively, you can just delete all these directories and everything should work when you boot SPD).
  5. Delete the assembly with the name similar to the one you are changing.
  6. Boot SPD.
  7. You can now work with your updated activity.
Good luck and have fun!

Tuesday, 10 July 2012

Problems with SPUtility.SendEmail in custom timer job

Last week I ran into a strange problem. I wrote a custom timer job which will send reminder emails to employees who haven't finished their task after a certain time.
Problem(s):
Sending emails is easy, by using the SPUtility.SendEmail function. Well, at least it should be easy. There are a lot of code samples, so search around for some if you need it. However, again I ran into a SharePoint problem. This function returns a boolean value and gave me 'false' all the time. I tried to use the ordinary mail method of System.Net.Mail. There I got an error about "Message rejected as spam by Content Filtering". Some research of the IT department on Exchange did not solve this problem.
Well, I went back to the SPUtility.SendEmail function. I turned out that using the StringDictionary gave some problems as well as using HTML tags. Using plane text and one of the other overloads that doesn't use the StringDictionary results in a successful send action. But I needed a formatted message (sending some links).
The LOG files gave some extra information on the 'false' action. And yes, it shows why it didn't send the messages: 550 5.7.1 Message rejected as spam by Content Filtering.
Solution:
The solution I found (here) was relatively easy. Bypassing the content filter for a specific email address (or even sender domain). To do this, you need to resort to the Exchange shell (EMS) to manage it.

  1. Click on Start > All Programs > Microsoft Exchange 20xx > Exchange Management Shell. Note, this works for at least Exchange 2007 and 2010 versions.
  2. Create the bypass for the 'from' email address you use when sending the email from a timer job:
    Set-ContentFilterConfig -BypassedSenders somebody1@mycompany.com, somebody2@mycompany.com
Note: You need to realize that spammers can spoof the 'from' address and this would allow spam to get thru.
So, after all, it was not really a SharePoint problem, but an Exchange 'problem'.

Thursday, 5 July 2012

Value does not fall within the expected range

Currently working on SharePoint and yep, running into strange problems and errors. A better name will be ShareProblems or SharePointless. However, just kidding a bit. But seriously, I run into the following situation:
Situation:
Running a webservice outside SharePoint which will receive data from a webform (on another server) in JSON format. The received data will be saved in a SharePoint list by using the client side object model. So far so good. The initial test where run by the administrator account (used for the installation and configuration of SharePoint). It worked fine. Because I have to run a workflow on 'new item created' on the SharePoint list, I needed a 'normal' account. The admin and service accounts are not allowed to start workflows. So, new AD account defined, gave the appropriate rights and voila... uh, not really.
Problem: 
Part of the code:

ListItemCreationInformation lici = new ListItemCreationInformation();
ListItem item = list.AddItem(lici);

item["Title"] = HttpUtility.UrlDecode(name);
item["Category"] = (categorie == "0") ? 15 : int.Parse(categorie);
item["Street"] = HttpUtility.UrlDecode(street);
item["Postal_x0020_Code"] = HttpUtility.UrlDecode(postalcode);

item.Update();
_clientContext.ExecuteQuery();


I got the return message: Value does not fall within the expected range.
The callstack was something like this:

at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream) at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse() at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery() at DnmWebServices.MessagingService.SendRtvRequest(String name, String category, String street, String postalcode) in c:\inetpub\wwwroot\DnmWebServices\App_Code\MessagingService.cs:line 128
Line 128 in my case points to the _clientContext.ExecuteQuery.
Solution(s):
It seems there can be several causes.
1). Use of invalid field name. You need to use the internal field name! However, that was not the case in my situation.
2). Change the List View Lookup Threshold value of the web application. Default value is 8, I changed it to 20 and big surprise: it worked! Thanks to this post.
Note: My item has some lookup fields some of which some have more than 8 items.
Little conclusion: So it seems that when using (one of) the system admin accounts, this list view lookup threshold is ignored in one way. By using non-system admin accounts, it can be a show stopper.
Steps to edit this value:

  • Go to Central Administration > Application Management > Manage web applications
  • Select the appropriate web application (in my case the SharePoint - 80)
  • In the ribbon bar, select General Settings > Resourse Throttling
  • Search for the List View Lookup Threshold and change the value to 20.

Friday, 15 June 2012

IE9 and SharePoint 2010: Memory Leak!

Today, I ran into a really stupid issue. It seems that IE9 has a memory leak when using SharePoint 2010. On each refresh of a SharePoint 2010 page, the amount of used RAM is increasing by approx. 5 MB.
I found a lot of talking about it, but no solution yet.
Seems that Microsoft doesn't work on that, well at least don't let know us.
By the way, I am running Win7 x64.
Absolutely stupid. You cannot expect end-users to restart their IE9 browser a couple of times during the day. Even more ridiculous is the fact that IE8 doesn't have that issue.

Possible solution: deactivation of the ActiveX NameCtrl. Let's try that, or use another browser.

Wednesday, 5 October 2011

MOSS 2007 - Upload size and HTTP-error 404.13

Today I discovered a strange behaviour of MOSS 2007 in combination with IIS 7. Normally you set the maximum upload size on web application level, inside the central administration. Guess what, that doesn't work at all when you are running MOSS 2007 on a IIS 7. You will raise into a "HTTP-error 404.13 Not Found". Thanks to internet, I found the solution (it worked for me, so give it a try).

Solution 1 - Changes for all web sites:
Next statement will set the maximum file upload size to 100MB. Note: the maxAllowedContentLength is in bytes!
%windir%\system32\inetsrv\appcmd set config -section:requestFiltering -requestLimits.maxAllowedContentLength:104857600
Solution 2 - Changes for a web app:

%windir%\system32\inetsrv\appcmd set config "Default Web Site/" -section:requestFiltering -requestLimits.maxAllowedContentLength:104857600
Just execute the statement in a command prompt.

Monday, 27 June 2011

Raise (custom) event after closing jQuery popBox

Recently I started to use the jQuery plugin popBox (http://plugins.jquery.com/project/popBox). This plugin provides a simple to use popup textarea extension for textboxes. The nice thing is that it works on hidden textboxes as well.

For my hour registration form I have some hidden textboxes to keep the form a bit clean. The form supplies textboxes for each day (see figure).
So for each day you can add hours, comment en log-info. The last two fields are hidden. To edit the comment and/or log-info you just press on the corresponding image.
Because these fields are invisible, you want to have some kind of indication if some text has been entered already or not. So I want to change the 'button'image if some text has been entered.
Raising an event seems to be a hard job, because you don't really access the (hidden) textbox, so their events are not raised. After some search and trial and error I found a solution.
First of all, let me show you how I attached the jQuery popBox plugin to my hidden comment and log-textboxes (see instructions at http://plugins.jquery.com/project/popBox). The hidden textboxes where called like txtNewMonComment, txtNewMonLog, txtNewTueComment etc.

1. I applied the popBox to all textboxes with class set to 'txtDailyComment':
$(document).ready(function () {
 //attach popBox jQuery plugin to all textboxes with class=txtDailyComment.
 $('.txtDailyComment').popBox();
});
2. The images that simulates a button are configured like this:
<img alt="Comment" src="/hrt/_layouts/images/DNM.WP.HourRegistrationGeneralForm/message_add.png"  onclick='SetTextboxFocus($(this));' id="btnNewMonComment" />
3. I wrote the SetTextboxFocus function to show the content of the corresponding hidden textbox:
function SetTextboxFocus(button) {
 var day = button.attr("id").substring(6, 9);
 var type = button.attr("alt");
 var control = "txtNew" + day + type;
 $("input[name=" + control + "]").focus();
}
So far is just like the instructions on the popBox plugin page.
4. The customization starts here and is quit simple. I wrote a function that I want to fire after closing the popBox. You can do whatever you want in this function. For demo reason I just show an alert:
function AfterTextboxUpdate() {
 alert('popBox is closed');
}
5. The popBox plugin supports option parameters. So I just add one of myself. I changed the popBox attach as written in step 1 as follows:
$(document).ready(function () {
 //attach popBox jQuery plugin to all textboxes with class=txtDailyComment.
 $('.txtDailyComment').popBox({ onclose: function () { AfterTextboxUpdate(); } });
});
6. The last step is to edit the popBox1.3.0.js file. Find the part where blur function is fired and add "options.onclose();" inside the if-section:
popBoxContainer.children().blur(function () {

 if (change) {

  $(this).parent().hide();
  $(this).parent().prev().hide();
  $(this).parent().prev().prev().val($(this).val().replace(/\n/g, options.newlineString));
  options.onclose();
 }
});
That's it. When you close the popBox, the AfterTextboxUpdate function will be fired.


Hope this helps you to get even more about this great jQuery plugin.

Tuesday, 22 March 2011

The query uses unsupported elements

I am using SPMetal for creating partial classes for accessing my SharePoint lists by code.
Today I was trying to run a Linq query in LinqPad on a SharePoint list (see here how to use LinqPad on SharePoint data). See query:
var q = from w in WorkItems
  where w.ShortUserID == "rob"
  where (((DateTime)(w.WorkDate)) >= firstDay 
     && ((DateTime)(w.WorkDate)) <= firstDay.AddDays(6))
  select new {w.Title, w.WorkDate, w.Hours, sprint = w.SprintItem.Title};
q.Dump();
Well, it's just an ordinary Linq query, but as always with SharePoint related programming, nothing goes well the first time. I got the following error message:
The query uses unsupported elements, such as references to more than one list, or the projection of a complete entity by using EntityRef/EntitySet
It has something to do with the 'sprint' information I needed. The 'SprintItem' is a property (Type of SprintItem object) of the WorkItem class. Somehow this will fail.
An explanation given by Paul Beck (see his blog):
ToList() method forces immediate query evaluation and returns the generic that contains the query result. As described in the MSDN article LINQ can't convert the LINQ to SharePoint into a CAML query so by using the ToList() method, the query is broken into 2 stages. This will apply to queries that use JOINS, UNIONS, and various other LINQ operators as described in the MSDN Unsupported LINQ queries article.
In his article he relates this problem with 'join'. However, I didn't use this keyword. Nevertheless his solution worked, I needed to put 'ToList()' right behind 'WorkItems' and the problem is solved. So the code will now looks like:
var q = from w in WorkItems.ToList()
  where w.ShortUserID == "rob"
  where (((DateTime)(w.WorkDate)) >= firstDay 
      && ((DateTime)(w.WorkDate)) <= firstDay.AddDays(6))
  select new {w.Title, w.WorkDate, w.Hours, sprint = w.SprintItem.Title};
q.Dump();

Friday, 4 March 2011

SPException: Field type is not installed properly

During my trial to create a custom cascade filtering lookup field, I run into the following exception:
SPException: Field type is not installed properly
There are several possible situations that can cause this error. E.g. using the optional field SPQuery in the fldtype_.xml is not allowed for custom field (see also http://msdn.microsoft.com/en-us/library/aa544201.aspx).
However, this was not my issue. I made a little (stupid?) mistake in the xml file. The field FieldTypeClass should show the full class name (including the entire namespace) as well as the full assembly name (I forgot the class-part, as shown in bold). So it should look like this:
<Field Name="FieldTypeClass">Dnm.SP2010.CF.AutoFilteredLookup.AutoFilteredLookupField, Dnm.SP2010.CF.AutoFilteredLookup, Version=1.0.0.0, Culture=neutral, PublicKeyToken=93ec60d3306981cd</Field>

Wednesday, 2 March 2011

customerrors mode off not working on SharePoint 2010

During the developing of a custom field, I faced some errors, but the didn't work.
After some search, it seems that you have to do this trick on three locations. SharePoint 2010 has web.config files on the following locations:
  • C:\inetpub\wwwroot\wss\VirtualDirectories\80\
  • C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\
  • C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS
On all these locations you can find a web.config file.
Change customerrors to:
<customErrors mode="Off" />
and the SaveMode tag (if available) to:
<SafeMode MaxControls="200" CallStack="true" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="true">
as well as the compilation tag to:

<compilation batch="false" debug="true" optimizeCompilations="true">
This did the trick for me

Thursday, 9 December 2010

Access denied SharePoint Farm account

Problem:
Today I ran into a strange problem. I was working on the Central Administration (CA) of SharePoint Server 2010. I was planning to manage some system settings (manage servers in this farm). To my surprise I got a 'Access Denied' message.
Solution:
After searching around for a while, some reboots, changing authorization settings in the web.config I found the solution. I made a bookmark inside IE to navigate to the CA. I started just IE and clicked on this bookmark. And thats not good!
You need to run Internet Explorer explicit in administrator mode to get full access to all options inside SharePoint's CA.
It seems that is has something to do with UAC.

Thursday, 21 October 2010

Cannot connect to database master at SQL server

During installation of SharePoint 2010 the Configuration Wizard could not connect to the SQL Server database:
Cannot connect to database master at SQL server at SERVERNAME. The database might not exist, or the current user does not have permission to connect to it.
Several blogs where dealing with the permissions, which I checked, but they were well set. The actual problem was the TCP/IP setting of SQLServer. The TCP/IP protocol for the SQL Server was disabled (default setting on installation). Enabling this setting solved the problem.
Enabling can be done using the Sql Server Configuration Manager. Go to SQL Server Network Configuration > Protocols for MSSQLSERVER (or the named instance name you are using) en check the TCP/IP protocol status. This should be 'Enabled'.

So, if you are running into this error, check the user accounts settings as well as the TCP/IP settings of the SQL Server.

Update (23 August 2012): I just add an extra addition: Make sure that SQL server is listening on port 1433 (Thanks to Suolon)

Tuesday, 19 October 2010

The list cannot be displayed in Datasheet view

Until a couple of weeks ago, I was using Office 2007 on a Windows 7 (x64). Showing SharePoint (MOSS 2007) lists in datasheet view worked fine.
Recently, I changed to Office 2010 (Prof, x64) edition. I fully uninstalled Office 2007 and installed Office 2010.
Then the following error shows up when using the datasheet view:
The list cannot be displayed in Datasheet view for one or more of the following reasons:

- A datasheet component compatible with Windows SharePoint Services is not installed.
- Your Web browser does not support ActiveX controls.
- Support for ActiveX controls is disabled.

To my surprise, the solution is to install 2007 Office System Driver: Data Connectivity Components, or with other words the Access Database Engine.
So if you love surprises, start working with SharePoint and Office ;)
BTW, I am working with IE8.

Friday, 24 September 2010

Userprofile picture through SSL

I have written an advanced contact web part. This web part shows the details of an user that is contactperson for that specific site. One of the options is showing the profile picture. Through the intranet it works fine. Through the extranet (which is available via SSL) it didn't work.

In the web part, I store the accountname of the user. When showing the web part, I will retrieve the details from the user profile, using the UserProfileManager and UserProfile (namespace: Microsoft.Office.Server.UserProfiles). The properties of the user are gotten from the property collection.
One of the properties is the "PictureUrl". I was assuming those url was server relative, but unfortunately it isn't. So I overcome this problem to create a Uri object, based on the retrieved PictureUrl and uses from that Uri object the PathAndQuery property. Using this value as an url for the image tag works perfectly fine.

Monday, 30 August 2010

Issues regarding ItemAdding and ItemUpdating EventReceivers when not firing

Today I succeeded in creating working event receivers for my custom list in a MOSS 2007 environment.
I had some difficulties to get those EventReceivers fired. I started with ItemAdding and ItemUpdating events. Those where installed and fired correctly.
But I actually needed the ItemAdded and ItemUpdated events. So I switched to them. And there the problems started.

One big problem is the caching (or something like that) of the elements.xml file of the feature (between brackets: don't forget to change the events in the elements.xml file!). Upgrade of the solution won't work!

You need to uninstall and remove the feature from the solution store. Make sure that all files of the feature are gone from the 12-hive\template\features\-folder.
To make sure that you really get rid of all the old version feature settings, do a IISRESET /NOFORCE. Until I did this, SharePoint remembers some settings of the old version feature. This is quit anoying and frustating and took me a while to get this sort out.

Friday, 28 May 2010

Include or Exclude Users from SharePoint Profile Import

During a (default) import of user profiles (from Active Directory (AD)) inside SharePoint (MOSS) you will notice a bunch of user profiles you are not interested in (like system_mailbox, some dummy users as well as disabled accounts).
I was wondering if it would be possible to exclude these AD user profiles during the profile import in SharePoint. After a little search, I found the solution to obtain this.

You need to go to your SharedServiceProvider (from within the Central Administration). Navigate to 'User Profile and Properties' > 'Manage Connections'.
Here you will find the field called 'User filter'. The content will look like this (which is default):
(&(objectCategory=Person)(objectClass=User))

Between '(&' and the last ')' (let's say the filter placeholder) you can add fields you want to filter on. Add the following string just after the last fieldfilter to exclude those user accounts that are disabled in AD:
(!userAccountControl:1.2.840.113556.1.4.803:=2)
So the entire string will be like this:
(&(objectCategory=Person)(objectClass=User)(!userAccountControl:1.2.840.113556.1.4.803:=2))
If you also want to include only those user accounts where (e.g.) the company name is filled in, you need to include (company=*). In reverse, if you want to exclude those that have a company name, just place a exclamation mark right for company: (!company=*). The 'include' version will then look like this:
(&(objectCategory=Person)(objectClass=User)(company=*)(!userAccountControl:1.2.840.113556.1.4.803:=2))
An easy way to figure out to create your own filtersyntax (like company start with 'bla'), you can build easily a query inside AD which will show you the correct syntax.

Thursday, 20 May 2010

Is SharePoint a PITA?

Sometimes SharePoint drives me crazy. But not only me. Google, our big friend shows the following results on some search terms:
  • moss 2007 problem: about 53.400.000
  • moss 2007 errors: about 8.160.000
  • moss 2007 bug: about 28.000.000
  • moss 2007 failed: about 4.560.000
  • moss 2007 failure: about 8.420.000
  • moss 2007 not working: about 23.300.000

  • sharepoint problem: about 8.270.000
  • sharepoint error: about 3.380.000
  • sharepoint bug: about 1.920.000
  • sharepoint failed: about 892.000
  • sharepoint failure: about 1.240.000
  • sharepoint not working: about 16.300.000

  • wss 3.0 problem: about 334.000
  • wss 3.0 errors: about 237.000
  • wss 3.0 bug: about 78.500
  • wss 3.0 failed: about 90.500
  • wss 3.0 failure: about 855.000
  • wss 3.0 not working: about 289.000
Do these numbers say something? I don't know. Is SharePoint a PITA? Well sometimes it definitely is!

Wednesday, 12 May 2010

A Solution for: SharePoint 2007 Workflow 'Failed on start'

The Problem:
I struggled some time to get my out-of-the-box (OOB) workflow working on a MOSS 2007 environment (Win2K3 64-bit). I got always the error 'Failed on Start'. The log file on the 12-hive shows two records like this:

w3wp.exe (0x0AF4) 0x0724 Windows SharePoint Services Workflow Infrastructure 72fs Unexpected RunWorkflow: System.ArgumentException: Value does not fall within the expected range. at Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties..ctor(SPWorkflow workflow, Int32 runAsUserId, String associationData, String initiationData) at Microsoft.SharePoint.Workflow.SPWinOEWSSService.MakeActivation(SPWorkflow workflow, SPWorkflowEvent e) at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(Guid trackingId, SPWorkflowHostService host, SPWorkflow workflow, Collection`1 events, TimeSpan timeOut) at Microsoft.SharePoint.Workflow.SPWorkflowManager.RunWorkflowElev(SPWorkflow originalWorkflow, SPWorkflow workflow, Collection`1 events, SPRunWorkflowOptions runOptions)


w3wp.exe (0x0AF4) 0x0724 Windows SharePoint Services Workflow Infrastructure 98d7 Unexpected System.ArgumentException: Value does not fall within the expected range. at Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties..ctor(SPWorkflow workflow, Int32 runAsUserId, String associationData, String initiationData) at Microsoft.SharePoint.Workflow.SPWinOEWSSService.MakeActivation(SPWorkflow workflow, SPWorkflowEvent e) at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(Guid trackingId, SPWorkflowHostService host, SPWorkflow workflow, Collection`1 events, TimeSpan timeOut) at Microsoft.SharePoint.Workflow.SPWorkflowManager.RunWorkflowElev(SPWorkflow originalWorkflow, SPWorkflow workflow, Collection`1 events, SPRunWorkflowOptions runOptions)

The Solution:
I search a lot, but didn't find a working solution. Finally I found it. It turns out that I had changed the account for the SharePoint - 80 application pool (don't remember why, but I did). But, I did this on IIS 7 and not using the Central Administration (CA).
Well, this was a wrong action. Changing the account of one of the SharePoint application pools must be done using the Central Administration (Serviceaccounts on the 'operations' page inside the CA).
And again, a big SharePoint miracle occured: the workflows started to work!