Skip navigation

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

Hide 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.