Killing Windows Scheduled Tasks running SharePoint scripts

Many SharePoint scripts are run using the native Windows Task Scheduler to automate actions while end-users are enjoying the portal experience.

Most of these are triggered at various intervals to update lists, send automatic email notifications, reminders or some important business information to stakeholders. At various instances, I recd. issues from end-users complaining about not receiving information on time that were triggered off using the task scheduler.

My investigation revealed that the Windows Task Scheduler has tasks that were running indefinitely with their status frozen on “Running”. This was an obvious concern as most of the scripts took fraction of a second to execute. Furthermore, if I right clicked an affected item and choose to “End Task” produced absolutely no effect.

Immediate response would be to end up rebooting the server or finding some other way of killing svchost.exe tasks that could kill your SharePoint processes if they were dependent on any. It was not the scripts in itself but the scheduler threads that launched and then hung themselves.

With a bit more digging around and research, I discovered that restarting the task scheduler service did the trick. Just launch Services.msc and restart the Windows Task Scheduler. The status on the hung tasks should clear themselves or refresh to reload new status.

I’m not sure what caused this to happen. Will debug my scripts to see if they are causing it to hang.

Nevertheless, one more issue workaround for making life easier…!

Using SharePoint Data in your LightSwitch Applications

One of the great features of LightSwitch is that it lets you connect to and manipulate data inside of SharePoint. Data can come from any of the built in SharePoint lists like Tasks or Calendar or it can come from custom lists that you create in SharePoint.

LightSwitch provides the ability to connect to multiple data sources like external databases and SharePoint and relate them together. However when you want to present data from multiple data sources on the same screen you need to tell LightSwitch the order in which you want to save this data.

See link below for a video presentation on how to achieve this:
http://msdn.microsoft.com/en-us/lightswitch/hh312789

LightSwitch is the new way to go…. reduced development time, reduced effort – maximized results!

Microsoft unveils Windows 8 (video)

Check out this live event posts coming from Microsoft Windows president Steven Sinofsky’s keynote at D9.

Read the full article here:
http://www.engadget.com/2011/06/01/microsoft-unveils-windows-8-tablet-prototypes/

Looks like some huge improvement to MS UX finally!

Cheers!

Open with Windows Explorer in SharePoint (Fix Slow WebDAV Performance on Windows 7 / Vista)

SharePoint users and likewise other application users that use WebDav Explorer mode on Windows 7 and Windows Vista PC’s may experience very slow file browsing, opening and modification (e.g. SharePoint Explorer View using WebDAV).

How simple would it be to just uncheck a certain option in IE and fix this brain busting issue, especially for Network Admins and SP Admins?

Solution

  1. Open Internet Explorer
  2. Go to the Menu “Tools” > “Internet Options” then go to the “Connections” tab
  3. Click on button “LAN Settings
  4. Uncheck the box “Automatically detect settings” (culprit)
  5. Close and restart all running Internet Explorer processes
  6. Restart the “Web Client” Service, if needed.
  7. Start browsing again…!
  8.  

Now for a bit of knowledge building

What is the “Automatically Detect Settings” option in IE?

The “Automatically detect settings” option is there to help the user in configuring a web proxy automatically. It actually makes use of the WPAD protocol to discover a web proxy.

1. If the PC is configured to do DHCP, then it will query the server. If the response includes a string with id 252, then it uses this to retrieve a configuration file.

2. If this fails, then the PC will attempt to resolve the name wpad. It will start in its current domain, and work back through. Eg, if the PC is called bob.cs.anu.edu.au, it will attempt to resolve wpad.cs.anu.edu.au, followed by wpad.anu.edu.au, etc. If this resolves the name wpad, then IE will attempt to retrieve wpad.dat via http from the root of the server. You should probably redirect this to the configuration file.

3. If this yields no success, then IE goes direct.

 Now here is your delay, when Step 1 and Step 2 are running, time-out – finally deciding to open your WebDav folders directly. Phew!

Skip it… if you do not require the auto-discovery feature. Ask your network admin to push a GPO to turn-it-off or uncheck it by default!

Microsoft All-In-One Code Framework

Hi,

Going through my regular rounds on the CodePlex home page, I spotted an amazing opportunity for newbies and long-time developers alike to get a one-stop-shop coding avenue – without too much typing … yawn!

The Microsoft All-In-One Code Framework from CodePlex http://1code.codeplex.com/ - check it out, it’s worth a download…!

  • Are you frustrated by the lack of code samples for a certain programming task?
  • Have you ever struggled to quickly get started with a technique?
  • Have you expected someone to write code samples for you based on your requests for free?
  • Is a one-stop code sample library for all Microsoft development technologies attractive to you?

If your answer is YES to any of these questions, the Microsoft All-In-One Code Framework is for you!

The Microsoft All-In-One Code Framework is a free, centralized code sample library driven by developers’ needs. Our goal is to provide typical code samples for all Microsoft development technologies, and reduce developers’ efforts in solving typical programming tasks.

Click the link below to get all their releases:
http://1code.codeplex.com/releases

Enjoy that every bit of code you write :)

Overview: Creating Workflows with SharePoint Designer 2010, InfoPath 2010 and Visio 2010

Forms and Workflows are important for automating business processes. Companies usually rely on programmers to create the forms and workflows using code. Not anymore! With InfoPath 2010 and SharePoint Designer 2010, you can create powerful data driven form composite solutions on your SharePoint sites. InfoPath gives you the ability to pull data from databases and lists, and create forms with data validation and conditional formatting. SharePoint Designer’s workflows let you then design powerful multi-step workflows centered around the form collected data, building upon the out-of-the-box reusable workflows and even import workflow designs from Visio! In this presentation, you will see how these tools come together to design workflows and route forms across your organization for task assignment and approval, and also how you can reuse your workflows in other lists and libraries on your site.

This session is presented by Asif Rehmani during SharePoint Connections 2010 in Amsterdam.

Awesome, check it out…!

Open Data Protocol (OData) for SharePoint 2010

The Open Data Protocol (OData) is a Web protocol for querying and updating data that provides a way to unlock your data and free it from silos that exist in applications today.

OData is consistent with the way the Web works – it makes a deep commitment to URIs for resource identification and commits to an HTTP-based, uniform interface for interacting with those resources (just like the Web).   This commitment to core Web principles allows OData to enable a new level of data integration and interoperability across a broad range of clients, servers, services, and tools.

Any data you’ve got on SharePoint as of version 2010 can be manipulated via the OData protocol, which makes the SharePoint developer API considerably simpler.

Click here to check it out

Clearing the InfoPath 2007 local form template cache

All InfoPath forms loaded either from your SharePoint site or other sources are downloaded as templates and cached locally.

It occurs that templates upgraded on the server are not automatically refreshed on the local client and gets a version from the local cached copy instead. Problem!

You need to clear the local cache. Use the options below to do the same:

You can rectify this by clearing the local cache:
Start > Command Prompt (cmd) > “Infopath /cache clearall”

Verify that the cache has been cleared by navigating to the following folder for Windows XP or Windows Server 2003:
“C:\Documents and Settings\[User]\Local Settings\Application Data\Microsoft\InfoPath\FormCache2″

Or for Vista / Windows 7:
C:\Users\[User]\AppData\Local\Microsoft\InfoPath\FormCache2

Within the “FormCache2″ folder there will be a folder with a GUID name, verify within this folder, it should be empty, except retaining a file “_SCVer.dat”.

Alternatively, you can manually clear the Infopath cache by deleting the files in the FormCache2 folder.

Have fun coding.

Error: InfoPath cannot open the selected form

Many InfoPath developers have faced this issue several times when they make a bunch of views, tons of coding effort and a small modification in the form results into “InfoPath cannot open the selected form”.

There is not much information provided to help resolve this issue within the Event Log or any other location.

During my development experience I noticed that form templates that are signed and often have created this issue. Try the resolution below to workaround this issue and let me know if this works for you:

From the Menu > Tools > Form Options > Security and Trust > uncheck “Automatically determine security level” and select Full Trust > OK.

It would work for certain cases where this could be the problem. But not assured!

You can revert back the Security and Trust options as needed. Worth a try!

: )

SharePoint list or site templates too large for import / export… use STSADM

I love MOSS! But there are some workarounds that you always need to look into if you want your portal to be happy!

Imagine you spent hours on customizing a site that you want to reuse as a template to create new sites. But you hit a dead-end.

Issue 1:
The maximum DEFAULT size permitted by SharePoint for a list or site to be saved as a template is 10MB. Even though I have received the message unexpectedly on sites as small as 5MB or 6MB.

Anyways the fix for this is to increase the maximum permitted property “max-template-document-size” using STSADM. See command below:

stsadm -o setproperty -propertyname max-template-document-size -propertyvalue 50000000
[Ref: http://blogs.provoke.co.nz/Ari/archive/2007/05/24/increasing-the-maximum-size-of-list-templates.aspx]

You should now be able to export your site template and save it to a local drive on your MOSS box.

Issue 2:
Now it’s time to use the newly exported site template just incase you need to create a root site collection (you will need to add it to the available Site Collection templates). Simply use the STSADM command below:

stsadm –o addtemplate –filename c:\exercise.stp –title exercise
[Ref: http://mindsharpblogs.com/kathy/archive/2007/04/10/1685.aspx]

Cheers!