????? ????????? ??? ????????? ??????? ?? ??????? ???????

?????? ????????? ?????? ?????????
???? ???????: 180546 - ??? ???????? ???? ????? ????? ??? ???????.
??? ????? ??? ???????. ????? "??? ??" ??? ??? ??????? ??? ????.
????? ???? | ?? ????

?? ??? ??????

??????

???? ??????? ??????? ??????? ?????? ?????? ???????? ??? ????????? ??????? ??? ???? ????? ????????? ???? ????? Windows NT ?? Windows 2000 ?? ???? ???? ?? ???.

??????? ????

???? ??? ?????? ????? ????? ???? ??? ???? ??? ????? ?????? ??? ???? ????????? ????????? ???????? ???????? ??? ?? ??????? ???? ????? ??????? Windows NT ?? Windows 2000 ???? ???? ????.

?????? ???? ??????? ??????? Netdom.exe ?? ????? ????? Windows NT 4.0 ?????? ????? ?????? ????????? ???? ????? Windows NT ??? ??????? ??? ??????? ??????? ?? ????? ????? ?? ????. ??? ????? ??????? ??? pinged ?? ??????? ?? ??????? ?????? ?? ??? ??? ????????? ??? ??????? ??????. ??? ??? ????????? ?????? ???????? ???? ????? Addusers.exe ???? ?????? ???? ?? ?????? ????????? ???????? ?????????. ??? ??? ???? ??????? ??? ???????? ? ???? ??? ????? ????? ?? ?? ??? ????. ??? ?????? ???? ????? ????????? ????? ?????? ????? ?????? ??? ????? ????? ????????? ?? ?????? ?????? ????? ????? ?? ????? ????????? ???? ?? ?? ??????? ???. ???? ????? ??? ?????? ????? ?????? ??? ???? ??? ????? ??? ????? ????????? ???? ?? ???? ????? ??? ??????. ??? NETDOM.EXE ? ADDUSERS.EXE REG.EXE ?? ????? ????? Windows NT 4.0 ??? ?????? ??? ???? ??????? ??????.

?????? ??? ??????? ??????? ?????? ??????? ???????:

  1. ????? ????? ????? ??????? ?? ??????? ?????:
    INSUSER.BAT ? SUB1.BAT ? SUB2.BAT ? SUB3.BAT ? SUB4.BAT ?
    SUB5.BAT ?? ADDUSERS.DAT.
  2. ????? ????? ????? ?? INSUSER.BAT ???? ??? ?????? ??? ???? ????? ????????? ?????.
  3. ????? <domain\user> ?? ????? ?????? ?? Addusers.dat ???? ??? ???????? ???? ???? ?? ??????? ??? ?????? ????????? ???????? ??? ???????. ???? ?? ??? ???? ???? ?? ???? ????? Addusers.dat.
  4. ?? ?????? ?????? ??? ???? ??????? ?????? ?????? ????? ?????? ?? ?????? ???? ???? ?? ??????. ???? ?? ????? ????? ????? Windows NT 4.0 ???? ???? ?????? ???? ?? ???? ???? ??????. ??? ?????? ?????? Netdom.exe Addusers.exe ?? ?????? ????? ???????.
  5. ????? ?? INSUSER.BAT. ?? ?????? ??? ????? ?????? ??? ????? ??? ?????.
  6. ??? ??????? Complete.txt Working.txt. ????? ????? Working.txt Complete.txt ????? ????? ??? ????? ????? ????????? ???? ?? ??????? ? ????? ????? ????????? ???? ?? ??? ????? ????????.
??? ??????? 6 & 5 ???????.

??? ??? ????? ??? ??? ????? ??????? ??? ?? ??????? ?? ???? ???? ????? .txt ?? ???? ?? ?????? 1.

??? ?????: INSUSER.BAT
set CurrentDomain=mydomain
echo off
cls
if (%CurrentDomain%) == (mydomain) echo Edit the first line of
INSUSER.BAT.
if (%CurrentDomain%) == (mydomain) echo then rerun INSUSER.BAT
if (%CurrentDomain%) == (mydomain) goto verybottom
if not exist addusers.dat goto DisplayAddUsers
rem *** Display current variable settings ***
echo Current domain is %CurrentDomain%.
echo.
rem *** Determine if working list is present ***
If exist working.txt echo Working list detected, resuming batch process.
If exist working.txt goto SkipCreateList
echo Creating a list of member servers in %CurrentDomain%.
echo.
netdom /d:%CurrentDomain% member > working.txt
rem *** Remove NETDOM formatting from server names ***
if exist temp.txt del temp.txt
for /F "skip=6 delims=\ tokens=2" %%a in (working.txt) do call sub1.bat
%%a
del working.txt
ren temp.txt working.txt
:SkipCreateList
rem *** Determine if machine is online ***
if exist online.txt del online.txt
for /F "delims=\\ tokens=1" %%a in (working.txt) do call sub2.bat %%a
rem *** Remove servers that have been processed from WORKING.TXT ***
if not exist online.txt goto NoServersOnline
echo.
echo Updating list of servers that need to be processed.
for /F "delims=  tokens=1" %%a in (online.txt) do call sub4.bat %%a
echo List complete.
goto Bottom
:DisplayAddUsers
Echo.
Echo. You must modify the contents of ADDUSERS.DA, then rename the
Echo. file to ADDUSERS.DAT.  Then re-run this batch file.
goto verybottom
:NoServersOnline
Echo.
Echo There are no servers currently online that can be processed.
:Bottom
echo.
echo ------------------------------------
echo --- Finished processing servers. ---
echo ------------------------------------
:verybottom
				

??? ?????: SUB1.BAT
rem *** Remove formatting from Netdom output ***
echo %1 >> temp.txt
				

??? ?????: SUB2.BAT
echo Pinging %1...
ping %1 > PING.TXT
for /F "skip=6 tokens=4" %%a in (PING.TXT) do call sub3.bat %%a %1
del PING.TXT
				

??? ?????: SUB3.BAT
rem *** If server is online it will be logged in online.txt for ***
rem *** processing later.                                       ***
rem ***    %2 is a bogus variable, thrown away.
if not (%1) == (bytes) goto NotOnline
echo %3 >> ONLINE.TXT
echo [%3 is online.]
rem ***********************************************
rem *** Put per-server processing commands here ***
rem ***********************************************
rem *** The following section determines if *******
rem *** Workstation or Server is running    *******
rem ***********************************************

REM Next Line wrapped by text editor for readability, it should all be on one line
for /F "delims=	 tokens=3" %%i IN ('reg query hklm\system\currentcontrolset\control\ProductOptions\ProductType \\%3') DO set product_type=%%i
REM End single line

if "%product_type%"=="" goto Undetermined
if "%product_type%"=="WinNT" goto Workstation
if "%product_type%"=="ServerNT" goto Server
if "%product_type%"=="LanmanNT" goto DomainController

:Undetermined
echo Unable to determine Windows NT Product Type, check the following
echo registry key for product type
echo.
echo hklm\system\currentcontrolset\control\ProductOptions\ProductType
echo.
echo Expected values
echo.
echo ProductType   Product
echo ----------------------------------------------------
echo WinNT         Windows NT Workstation is running
echo ServerNT      Windows NT Server is running
echo LanmanNT      Windows NT Domain controller
echo.
echo %3 >>undetermined.txt
goto Sub3bot

:DomainController
echo %3 >>dc.txt
goto sub3bot

:Server
echo %3 is a Server, skipping...
echo %3 >>server.txt
goto adduser

:Workstation
echo %3 is a Workstation, processing %3
echo %3 >> wks.txt
goto adduser

:adduser
ECHO Adding new user to local administrators group on %3.
ECHO *** \\%3 *** >> local.log
rem Add a user to each member servers local administrators group
ADDUSERS \\%3 /C addusers.dat > nul
rem *****************************************************
rem net send %3 "it worked"
rem *** Put per-server processing commands above here ***
rem *****************************************************
goto Sub3Bot
:NotOnline
:Sub3Bot
				
??? ?????: SUB4.BAT
rem *** loop thru each name in working.txt and remove servers that were
***
rem *** in online.txt.
***
echo Removing %1 from list.
if exist temp.txt del temp.txt
for /F "tokens=1" %%a in (working.txt) do call sub5.bat %%a %%1
del working.txt
if exist temp.txt ren temp.txt working.txt
				

??? ?????: SUB5.BAT
rem *** Filter out servers that have been updated ***
rem %1 is name from working.txt
rem %2 is name from online.txt
if (%1) == (%2) echo %1 >> complete.txt
if not (%1) == (%2) echo %1 >> temp.txt
				

??? ?????: ADDUSERS.DAT
[Local]
Administrators,Members can fully administer the computer,<domain\user>,
				

???????? ??? ???? ????? ????? ??? ??????? ??????? ?????? ??? ???? ??? ????? ????? ?? ???????? ???, ???? ????? ???????? ?? ????? ?????.

????? ???????? ?? ????? ?????

??? ??????? REG.EXE ?? reskit ???????? ?? SUB3.BAT ?? ????? ?????? ?????? ?? ??? ?????? ?? ??????? (?????? ? ???? ???? ????? ?? ??????). ?????? ????? goto ?? ?????: ?????? ?: ???? ????? ?????? ????? ?????? ?? ???? ????? ????? ????? ???? ?? ????? ????? ??? ???:

Sub3bot GOTO - ???? ???? ??? ????? ?? ??????. ??????? Adduser GOTO - ??: ??? ?????? ?????? addusers ?? ??? ????? ?? ??????.

??????? ??? ????? ???? ????? ???. ???? ????? ??????? complete.txt ??? ??????? ??? ????? sub3.bat. ???? ?? LOCAL.LOG ?????? ??????? ???? ?? ???????. ????? ??? ??? ????? ????? ???? ?? ??? ?????.

LOCAL.LOG ??????? ???? ?? ???????.

WKS.TXT ??????? ???? ?? ?????? ????? ?? ????? ?????.

SERVER.TXT - ??????? ????? ???????.

UNDETERMINED.TXT ??????? ???? ??? ????? ?? ???? ????? ?????? ?? ???? ????? ???? ?? ??? ??? ?????? ?????? ?? ???????. ?? ?? ?? ???? ????? ??????? ?? ???.

DC.TXT - ??????? ???? ???? ?? ????? ?????? ??? ???? ?? ???? ????? ??? ?????? ??? ?????? ?? ??????? ??????? ??? ??? ???? ???? ????. ?? ??? ?????? ??? ??????.

????? - ????? ????? ??????? ???? ??? ??? ?? ????? ?????? ???? ??????? ???? PING. ??? ??????? ??? ??????? ??? ????? ????? ????? ??? ??????? ?? ???????.

??? ????? SUB3.BAT
rem *** If server is online it will be logged in online.txt for ***
rem *** processing later.                                       ***
rem ***    %2 is a bogus variable, thrown away.
if not (%1) == (bytes) goto NotOnline
echo %3 >> ONLINE.TXT
echo [%3 is online.]
rem ***********************************************
rem *** Put per-server processing commands here ***
rem ***********************************************
rem *** The following section determines if *******
rem *** Workstation or Server is running    *******
rem ***********************************************

REM Next Line wrapped by text editor for readability, it should all be on
one line
for /F "tokens=3" %%i IN ('reg query
hklm\system\currentcontrolset\control\ProductOptions\ProductType \\%3') DO
set product_type=%%i
REM End single line

if "%product_type%"=="" goto Undetermined
if "%product_type%"=="WinNT" goto Workstation
if "%product_type%"=="ServerNT" goto Server
if "%product_type%"=="LanmanNT" goto DomainController

:Undetermined
echo Unable to determine Windows NT Product Type, check the following
echo registry key for product type
echo.
echo hklm\system\currentcontrolset\control\ProductOptions\ProductType
echo.
echo Expected values
echo.
echo ProductType   Product
echo ----------------------------------------------------
echo WinNT         Windows NT Workstation is running
echo ServerNT      Windows NT Server is running
echo LanmanNT      Windows NT Domain controller
echo.
echo %3 >>undetermined.txt
goto Sub3bot

:DomainController
echo %3 >>dc.txt
goto sub3bot
				

???????

???? ???????: 180546 - ????? ??? ??????: 23/???? ??????/1435 - ??????: 2.2
????? ???
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Professional Edition
  • Microsoft Windows NT Workstation 3.5
  • Microsoft Windows NT Workstation 3.51
  • Microsoft Windows NT Workstation 4.0 Developer Edition
  • Microsoft Windows NT Server 3.5
  • Microsoft Windows NT Server 3.51
  • Microsoft Windows NT Server 4.0 Standard Edition
  • Microsoft Windows 2000 Advanced Server
????? ??????: 
kbnosurvey kbarchive kbmt kbinfo KB180546 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????180546

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com