⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 被锁定帐户.bat

📁 超强的批处理文件-系统类-网络类-其它类
💻 BAT
字号:
@echo off
REM This batch file can only be used on windows2000 or later OS in chinese simplified version.
 REM And this batch file can be used on workstations or member servers in a domain.
 REM The function of it is to get a list of all locked or disabled users of a domaim.
 REM Making a little change, you can use this batch file on windows in other language version or on domian controller.
 REM I marked those lines as follow.
 REM author: beginner@yeah.net http://blog.chinaunix.net/index.php?blogId=739 

cd /d %TEMP%
for %%i in (user2.txt lockedusers.txt) do if exist %%i del %%i 
 REM Changing the next 4 lines can meet your special require.
net user /domain |find /v "命令成功完成" >user.txt
for /f "skip=6 tokens=1" %%i in (user.txt) do echo %%i >>user2.txt
for /f "skip=6 tokens=2" %%i in (user.txt) do echo %%i >>user2.txt
for /f "skip=6 tokens=3" %%i in (user.txt) do echo %%i >>user2.txt

 REM Changing the next line can meet your special require.
echo net user %%1 /domain ^|find "帐户启用               No" >user.bat
echo goto answer%%errorlevel%% >>user.bat
echo :answer0 >>user.bat
echo echo %%1 ^>^> lockedusers.txt >>user.bat
echo goto end >>user.bat
echo :answer1 >>user.bat
echo :end >>user.bat

for /f %%i in (user2.txt) do call user.bat %%i
for %%i in (user.txt user2.txt user.bat) do if exist %%i del %%i
cls

@if exist lockedusers.txt (
date /t >> lockedusers.txt
time /t >> lockedusers.txt
notepad.exe lockedusers.txt
) else (
echo   There is no locked user!
pause
)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -