JSI Tip 1737. How do I use Resource Kit tools to restart a service on all BDCs?


Using tools from the Server Resource Kit Supplement 4.0, you can create a batch file that will use NETDOM to enumerate all BDCs in your domain and NETSVC to stop and start a specified service on each.

RSvcBDC.bat uses the following syntax:

RSvcBDC <Service>

where <Service> is the Key name at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services.

RSvcBDC.bat contains:

@echo off
setlocal
if \{%1\}==\{\} goto error
set svc=%1
for /f "Skip=6 Tokens=1-3*" %%i in ('netdom bdc') do call :rs "%%l"
endlocal
goto end
:error
@echo Syntax RSvcBDC Service
endlocal
goto end
:rs
netsvc %svc% %1 /stop
netsvc %svc% %1 /start >null
sleep 2
netsvc %svc% %1 /query
:end

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish