惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Exploit Database - CXSecurity.com
A
Arctic Wolf
K
Kaspersky official blog
T
Threat Research - Cisco Blogs
PCI Perspectives
PCI Perspectives
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
U
Unit 42
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
P
Privacy & Cybersecurity Law Blog
O
OpenAI News
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
Cisco Blogs
AWS News Blog
AWS News Blog
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
美团技术团队
T
Threatpost
S
Schneier on Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
Cyber Attacks, Cyber Crime and Cyber Security
Last Week in AI
Last Week in AI
C
CERT Recently Published Vulnerability Notes
Blog — PlanetScale
Blog — PlanetScale
C
Cybersecurity and Infrastructure Security Agency CISA
F
Full Disclosure
博客园_首页
N
Netflix TechBlog - Medium
Security Latest
Security Latest
有赞技术团队
有赞技术团队
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Register - Security
The Register - Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Recent Announcements
Recent Announcements
博客园 - Franky
P
Palo Alto Networks Blog
Project Zero
Project Zero
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
H
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Cisco Talos Blog
Cisco Talos Blog
H
Heimdal Security Blog
The Hacker News
The Hacker News
博客园 - 【当耐特】
GbyAI
GbyAI

博客园 - johnny tu

Moving............. Tech.ED North America 2008 Launch! (June 10-13,2008) 开启硬件辅助虚拟化——Intel虚拟化之旅 Exchange, I know something you don't know What is the Placeholder Domain Model? Office Communicator 2007 with Polycom How To Create AD Users with PowerShell - johnny tu Damn it! Microsoft Newsletters @ China. About the Statement Of Work(SOW) Microsoft Product Support's Reporting Tools Customizing the OC 2.0 Client /part 01 The ROUTE of OCS Edge Server got ERROR About Windows 2008 "Data Execution Prevention" - johnny tu exchange2007+outlook2007,无法使用外出助理 打开exchange2007管理控制台时,提示没有读取服务器安全描述符的权限 Exchange 2007 被攻击 exchange 2007 CCR 的...MSDTC 问题???? Exchange 2007 AcitveDirectory架构 智能邮件筛选疑问
在Exchange2007中,如何批量建立用户邮箱
johnny tu · 2007-11-17 · via 博客园 - johnny tu

刚看到新闻组提问批量新建邮箱的帖子,就顺便写一下。

其实很少情况下会用到批量建立用户及邮箱的操作,这一点很简单。但是很多时候在测试的时候要求进行批量建立用户及邮箱,ActiveDirectory中使用脚本就很容易实现,再结合ADModify.Net就能达到批量修改用户属性的效果。

在测试Exchange2007的时候,可以借助脚本来批量新建一批用户,然后再在EMS(Exchange Management Shell)里使用enable-mailbox LETCMD就能够批量为用户启用邮箱,非常方便。

批量新建AD用户脚本:(演示脚本在 Active Directory 内的用户容器中创建 1,000 个用户帐户(名为 UserNo1、UserNo2、UserNo3 等等)。此脚本用于测试需要多个用户帐户的方案。)

Set objRootDSE = GetObject("LDAP://rootDSE")
Set objContainer = GetObject("LDAP://cn=Users," & _
objRootDSE.Get("defaultNamingContext"))
For i = 1 To 1000
Set objLeaf = objContainer.Create("User", "cn=UserNo" & i)
objLeaf.Put "sAMAccountName", "UserNo" & i
objLeaf.SetInfo
Next
WScript.Echo "1000 Users created."

更多信息请参考:

http://www.microsoft.com/china/technet/community/scriptcenter/user/default.mspx

完成新建之后用ADModify.Net修改所有新建用户属性,例如密码及登录信息。

接下来在exchange命令控制台中,输入:

get-user UserNo* | enable-mailbox

的命令进行启用邮箱(关于Enable-Mailbox LETCMD命令请输入 man enable-mailbox)

还有一种方式就是不用VBS脚本来批量创建邮箱,将所要添加的用户编辑好做成.CSV表格文件,然后在用命令启用。这种方式更加的灵活也非常实用。

在Exchange 2007中,提供了通过模版创建邮箱的方法:
1. 先创建.csv文件,包含以下格式的内容:


Name,UPN,OU,Password
Deepak Kumar,DKumar@contoso.com,contoso.com/Users,pass@word1
Ray Chow,RChow@contoso.com,contoso.com/Users,pass@word1
David Simpson,DSimpson@contoso.com,contoso.com/Users,pass@word1
Isabel Martins,IMartins@contoso.com,contoso.com/Users,pass@word1


2. 在Exchange Management Shell 中输入以下命令:
$Template = Get-Mailbox "Template1" (template1 为一个已经创建了邮箱的用户名称,这个用户被用作创建其它用户的模版)


Import-CSV "C:\NewUsers.csv" | ForEach-Object -process {$Temp = ConvertTo-SecureString $_.Password -asPlainText -force;New-Mailbox -Name $_.Name -UserPrincipalName $_.UPN -OrganizationalUnit $_.OU -Database "Mailbox Database" -Password $Temp -TemplateInstance $Template}


这将根据csv文件中列出的用户创建邮箱,但这个方法不能为已经存在的用户创建邮箱。
更多的信息,请参考以下文章:
如何使用模板创建收件人
http://technet.microsoft.com/zh-cn/library/bb125152.aspx

致谢:

罗俊华
在线技术支持工程师
微软全球技术支持中心

Johnny tu.