Ashish's Note

Over the past few years, I learnt a lot and get fond of Microsoft Technlogy. From The basics of Active Directory to the high end troubleshooting and disaster recovery, to the VPN configuration, Its being a good time for me as I got lots of opportunities to learn and grow.

In 2004, I got hired by "Microsoft" as a full time employee in its GTSC located in Bangalore. I experienced hardcore troubleshooting on real time issues as a big challange and very very intersting, which gave me vibrant knowledge of Operating System Troubleshooting, Active Directory, Clustering, Performance, Disks, Terminal Server, Printing, STOP Codes and BSOD screens.

My Fantastic past experience on HP/MSCS cluster, Server Hardware and System Administration, boosted my skills to take charge of customer's problem and make me to deal with the issues till the resolution.


Today working with Perot Systems, I am using this Blog to contribute my knowledge to the society and to make every individual who need directives to grow in IT field.

Lets post your views and questions you have, hit my brain to let it mentor the best possible IT solutions and career options.

Yours,

Ashish Sharma.

Wednesday, June 11, 2008

Killing a Windows Service that seems to hang on "Stopping"


It sometimes happens (and it's not a good sign most of the time): you'd like to stop a Windows Service, and when you issue the stop command through the SCM (Service Control Manager) or by using the ServiceProcess classes in the .NET Framework or by other means (net stop, Win32 API), the service remains in the state of "stopping" and never reaches the stopped phase. It's pretty simple to simulate this behavior by creating a Windows Service in C# (or any .NET language whatsoever) and adding an infinite loop in the Stop method. The only way to stop the service is by killing the process then. However, sometimes it's not clear what the process name or ID is (e.g. when you're running a service hosting application that can cope with multiple instances such as SQL Server Notification Services).

The way to do it is as follows:


Go to the command-prompt and query the service (e.g. the SMTP service) by using sc:

sc \\Servername queryex SMTPSvc
This will give you the following information:

SERVICE_NAME: SMTPSvc

TYPE : 20

WIN32_SHARE_PROCESS

STATE : 4 RUNNING (STOPPABLE, PAUSABLE, ACCEPTS_SHUTDOWN)

WIN32_EXIT_CODE : 0 (0x0)

SERVICE_EXIT_CODE : 0 (0x0)

CHECKPOINT : 0x0

WAIT_HINT : 0x0

PID : 388

FLAGS :or something like this (the "state" will mention stopping).


Over here you can find the process identifier (PID), so it's pretty easy to kill the associated process either by using the task manager or by using taskkill:

taskkill /PID 388 /F

where the /F flag is needed to force the process kill (first try without the flag).

Wednesday, June 4, 2008

A Nice Lesson

You Can't Send a Duck to Eagle School by Mac Anderson

A few years ago I had lunch with a top executive from a company known for their legendary retail service. My wife and I are both big fans, and over lunch I shared with him some of the great service stories his people had provided the Anderson family.

I said, "With the service your people give...you must have training manual 2 inches thick."

He looked up and said, "Mac, we don't have a training manual. What we do is find the best people we can find and we empower them to do whatever it takes to satisfy the customer."

Then he said something I'll never forget.
He said, "We learned a long time ago that you can't send a duck to eagle school."

"Excuse me," I said. He repeated... "You can't send a duck to eagle school." He said, "You can't teach someone to smile, you can't teach someone to want to serve, you can't teach personality. What we can do, however, is hire people who have those qualities and we can then teach them about our products and teach them our culture."
As long as I live I will never forget this simple analogy about hiring people. It is branded on my brain forever. And since that day, with every hiring decision I've made, I find myself asking the question: "Am I hiring a duck thinking they will become an eagle?" I can also honestly say that asking this simple question has saved me from making some important hiring mistakes.

I just wish I'd heard it 20 years sooner.

The "Duck to Eagle School" lesson is one of many simple truths of leadership.