Life and things around it (WP)

Life experiences, SharePoint, coding issues and photography…

Archive for the ‘Coding’ Category

Coding and life; what our kids are missing

leave a comment »

Wandering around the land of Facebook, came across a video (watch it above) shared by a common friend. It got me thinking back in the time when I first got access to a PC (maybe way back in 1988 or 89) with a green screen and a blinking cursor announcing proudly the DOS prompt.

I just cannot forget the rush, the excitement of running first set of commands on DOS prompt and toying around with BASIC, DBase. Document editing with WordStar and WordPerfect. Playing around with DotMatrix printers and access to first Daisy Wheel Electronic Typewriter and excitement of connecting it to a computer and watching with wide wondering eyes, as each character printed itself (without touching the keys).

So what has learning to code to do with everyone’s life? Read the rest of this entry »

Advertisements

Written by Manpreet Alag

February 28, 2013 at 12:37 am

Posted in Coding, Learning, Life

Tagged with , ,

Control a Windows Service from SharePoint Central Admin site

leave a comment »

You are a very good developer and have created a great windows service that works like a charm and your CEO likes the functionality and would love to have your SharePoint Administrator control it from the SharePoint Central Administration Site !!!!

What a lovely scenario 🙂

But what also is interesting in this is, that the usual way to control windows services will not work properly when used from within the SharePoint. So then how do you do it? Well, SharePoint itself comes to our rescue and provides us a couple of classes knows as SPWindowsService and SPServiceInstance which will allow you to control your windows service from SharePoint.

Well, there are a few steps that you need to follow to make sure you are able to control and use the windows service from within the SharePoint’s context.

  • Use the classes SPWindowsService and SPServiceInstance classes to wrap the Windows Service.
  • Add these services to the Services to the servers of the farm.
  • Register the service to the desired servers in the farm.
  • Provide custom aspx pages (as Application Pages) that can be used to start/stop the service.
  • Use SPJobDefinition to start the service. This way, the service can also be started on a remote server.

For further reading, I would suggest that you go through this article in April 2009 edition of MSDN magazine.

Written by Manpreet Alag

February 27, 2013 at 11:45 pm

%d bloggers like this: