windows server 2003批量增加用户-addusers

windows server 2003批量增加用户的方法有很多,比如net、csvde、ldifde、dsadd、addusers等,这里将逐一介绍。

addusers
addusers命令是DOS的外部命令,下载路径:ftp://ftp.microsoft.com/bussys/winnt/winnt-public/reskit/nt40/i386/addusers_x86.exe。

详细的使用方法可使用addusers_x86.exe /?查询,下面列出英文帮助原文:
Command-line account manipulation utility version 3.0.0.1
Copyright Microsoft Corporation 1998.  All rights reserved.
 
Adds, Writes, or Erases accounts as specified by a delimited file.
ADDUSERS {/c|/d{:u}|/e} filename [/s:x] [/?] [\\computername|domainname] [/p:{l|c|e|d}]
  /?    Display this help screen.
  /c    Create accounts specified in the file.
  /d:   Write current accounts to the specified file, opt. followed by {:u}.
    u   Write current accounts to the specified file in Unicode text format.
  /p:   Set's account creation options, followed by an comb. of {lced}
    l   Users do not have to change passwords at next logon.
    c   Users cannot change passwords.
    e   Passwords never expire. (implies l option)
    d   Accounts disabled.
  /e    Erase user accounts specified in the file.
  /s:x  Sets the separator character for the input/output file.  Replace the
        x with the character to be used for separating fields. (e.g. /s:~)
        Note: The separator character is a comma ',' by default.
 
For detailed information please refer to the Resource Kit Help file.

用法示例:
导出当前用户:
addusers /d:u c:\users.txt
/d:u参数中:u是必须的,如果不加u,那么中文的2000将导不出用户和组的中文描述。

批量添加用户:
1、建立用户属性文档
[User]
laud,laud,laud,,,,

[Global]

[Local]
Enos_YY,YiYang,laud,
Remote Desktop Users,RDU,laud,
#注意组要以逗号结尾
2、执行命令
addusers \\wgcnms1 /c c:\user.txt /p:e
参数解释:
计算机名:要建立帐号的计算机名
/c:使用文件引入用户列表
file path:加/c参数后,指定文件路径
/p:l/c/e/d:帐号选项,其中:
l:使用者下次登录时需更改密码
c:使用者不得变更密码
e:密码永远有效
d:帐号暂停使用
posted @ 2009-08-19 16:18  eventer  阅读(2580)  评论(0编辑  收藏  举报