Discussion Locked

Server Service

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

We have a network with NT4 workstations and 2000 Pro workstations on a AD 2000 Domain. A number of these workstations have the 'server' service disabled. For a technician to visit each system, would require a great deal of man-hours. Therefore we are searching for a way to have this service start up or be set to automatic when the workstation is booted up. We have tried a group policy, and also a domain policy to have the service be set to automatic, however this did not work. Does anyone know of a relatively easy way to accomplish this task through a script, registry edit, etc which will set the server service to run. Note, we are a mix of NT4 and 2000 Pro computers. Any solution would need to be able to accomplish this on both OS's.

Thanks.

9 replies

by aaron_wurthmann

This can be accomplished via a logon script on the Windows 2000 systems assuming the person logging in has local admin rights. I don't have a Windows NT system here to see if the sc command is native. You may be able to put sc.exe in the same directory as your logon script and have the NT clients use it that way. Of course this requires that the users have admin rights and that you assign them logon scripts.

:start
sc.exe config lanmanserver start= auto
net start Server
:end

I am looking into a remote script for you as well. But unfortunately my users are bothering me at the moment. This job would be great without users. If I figure it out I'll post it here as well.

by aaron_wurthmann

Sweet. So no sc.exe does not exist on Windows NT 4. But that is okay cause you can run sc.exe remote. I'll write ya a quick script to enable Server on every system on your domain in a bit. Or would you preffer one that just enables it on a list of systems?

The goals of my script unless you say otherwise:
Set Server to "Automatic" on all systems on the current domain. (NOT ALL DOMAINS, though I can right one that does that too)
Start Server service on systems that it is not started on.

by aaron_wurthmann

Doh! Darn users roped me into something. I'll try to work on this tonight a little. It is pretty easy just requires a FOR loop and some tweaking to only start "Server" were needed.

by aaron_wurthmann

@echo off
title Enable and Start Server Service

for /F "usebackq eol=T skip=3 delims=\\ " %%i IN (`net view`) do (
Checking on %%i....
sc.exe %%i config lanmanserver start= auto
for /F "tokens=3 usebackq delims= " %k IN (`netsvc Server %%i /query`) do (
if "%%k"=="stopped" netsvc Server %%i /start
)
)

by aaron_wurthmann

oops TYPO on the %k, should be %%k.

So, just cut and paste this into a batch file. This script must be run as a domain admin and on a system that the Resource Kit tool "netsvc".

@echo off
title Enable and Start Server Service

for /F "usebackq eol=T skip=3 delims=\\ " %%i IN (`net view`) do (
Checking on %%i....
sc.exe %%i config lanmanserver start= auto
for /F "tokens=3 usebackq delims= " %%k IN (`netsvc Server %%i /query`) do (
if "%%k"=="stopped" netsvc Server %%i /start)
)

by aaron_wurthmann

WOW! I am blowing it tonight. ANOTHER TYPO. The first FOR command kills the \\, so they have to be added back in in order for the script to work. They could just have esaily have been left in. OK I think it is right now.

So, just cut and paste this into a batch file. This script must be run as a domain admin and on a system that the Resource Kit tool "netsvc".

@echo off
title Enable and Start Server Service

for /F "usebackq eol=T skip=3 delims=\\ " %%i IN (`net view`) do (
Checking on %%i....
sc.exe \\%%i config lanmanserver start= auto
for /F "tokens=3 usebackq delims= " %%k IN (`netsvc Server \\%%i /query`) do (
if "%%k"=="stopped" netsvc Server \\%%i /start
)
)

by aaron_wurthmann

OMG I SUCK! Sorry, this would be eaiser if I could edit a post instead of spamming it. I left out the echo on the Checking line. OK, All done I am goign to bed, good luck.

So, just cut and paste this into a batch file. This script must be run as a domain admin and on a system that the Resource Kit tool "netsvc".

@echo off
title Enable and Start Server Service

for /F "usebackq eol=T skip=3 delims=\\ " %%i IN (`net view`) do (
echo Checking on %%i....
sc.exe \\%%i config lanmanserver start= auto
for /F "tokens=3 usebackq delims= " %%k IN (`netsvc Server \\%%i /query`) do (
if "%%k"=="stopped" netsvc Server \\%%i /start
)
)

by rabbit_runner

After testing, and looking for other options, I found the following....
\\Server1\netlogon\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Start=00000002

It is placed in a logon script and when executed, sets the server service to automatic. Then upon the next reboot (usually at the close of a business week), the server service will become active.

Thanks for your input

This discussion is closed to new replies.