2006-01-10

How to Restore a Missing Server Service on Windows 2000 Professional

Here's a Windows fix you won't find in Microsoft's Knowledge Base because they probably won't officially acknowledge that the problem can exist.

There are plenty of services that are installed by default on a typical Windows system, and plenty of them are unnecessary. "Remote Registry"? More like "Please exploit me, Mr. Hacker". Same goes for the Wireless Zero Configuration service. It's pretty much useless to you if you're aren't using a laptop or other system with a wireless card in it.

So, as a rule, I will go through and disable any services I'm not going to use: Messenger, Windows Time, and so on. A common one that I turn off is Server, which is Very Important and you shouldn't screw around with it. One of the things Server does is provide automatic shares to your hard drives. That's bad.

So Server gets turned off on a lot of my workstations and all is right with the world. Until, that is, the day comes that someone wants to install some new database software that requires that the Server service be turned on. Easy to do, right? Just open up services.msc, find Server, and change its settings to "Start" and "Automatic". Piece of cake.

But what if you can't find the Server service? I'm not talking about it being hidden because you've accidentally resorted the services list by status instead of name. I mean you're going down the list of service names and it goes "RunAs Service", "Security Accounts Manager", "Smart Card", "Smart Card Helper". "Server" is completely gone!

From the lack of information about this in their KB, I suspect Microsoft's official stance is that this is either very uncommon or very impossible. Granted, I couldn't tell you how it happened, but clearly it has. I have a Windows machine with no Server service.

There is no documentation I could Google that could solve my problem, so I'm detailing it here, now, for what may very well be the first time ever. I'm setting a very boring Internet record today. I'm going to tell you how to fix a missing Server service on a Windows 2000 Pro machine.

Step one, take a working Win2K Pro machine. (Naturally.) Run "regedit" on the working machine and export the following key (and all subkeys):

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver

I put this into a .reg file and put it on my web server. You could just as easily have put it on a file server or a floppy drive or a USB thumb drive. Doesn't matter. All that's important is that you have the lanmanserver key exported from the working machine somewhere where the broken machine can get to it.

Step two, run "regedit" on the broken machine and delete the above lanmanserver key. Then, import the .reg file. This should efficiently remove everything under the lanmanserver key and replace it with a configuration identical to the one from the working machine.

Step three, go to http://support.microsoft.com/?kbid=128167 and follow the instructions at the end of the article about removing unnecessary values from the lanmanserver\Parameters key. You should only have a few values left with names like "Lmannounce" and "Size". Keys with other names like "Guid" should get pitched away.

If you restart the machine at this point, you'll bring the Server service back in services.msc, but you still won't be able to start it. The Event Viewer will complain about an "Error 2", and that it could not find the file specified. This error message furthermore fails to specify which file it cannot find.

Step four, open up your Control Panel and go to your Network configuration. Unless your machine is very, very secure, you probably have at least one network connection in this menu, so open its Properties. Usually, the Properties window will contain just a couple of lines like "Client for Microsoft Networks" and "Internet Protocol (TCP/IP)". If you do not see "File and Printer Sharing for Microsoft Networks", install it, then "Add Service". Otherwise, make sure the box next to "File and Printer Sharing for Microsoft Networks" is checked and click OK.

Step five, reboot your machine. Then, optionally, pump your fist in the air and chant "USA! USA!" until the neighbors yell at you to keep it down.

What we've done is take a working Server service configuration from a working Win2K machine and copied it to the broken system so that we could reconfigure it to run correctly. Adding the lanmanserver key recreates the service, but editing your network configuration by adding the file and printer sharing open is what restores the driver that the service looks for when it starts.

And that, my friends, is how you fix a problem Microsoft doesn't acknowledge exists.

No comments: