通过Exchange 的 Powershell批量建立AD账户和邮箱的图
日期:2014-08-28 / 人气: / 来源:网络
使用时在Exchange Powershell界面运行addmailbox.ps1,用户信息保存在mailbox.csv文件中
addmailbox.ps1这个文件需要使用文本编辑器打开,修改其中几处
$password= convertto-securestring Pass@word -asplaintext -force
$OUPath ="OU=mail,DC=RES,DC=Contoso,DC=COM"
function Addmailbox {
Write-Host -ForegroundColor yellow Creating user - ($_.split(','))[0]
new-mailbox -OrganizationalUnit $Oupath -name ($_.split(","))[0] -password $password -LinkedDomainController "nj-9l-dc-01.CORP.Contoso.COM" -LinkedMasterAccount ($_.split(","))[1] -UserPrincipalName ($_.split(","))[1] -LinkedCredential $s -DisplayName ($_.split(","))[0] -database ($_.split(","))[2]
set-mailbox -identity ($_.split(","))[1] -PrimarySmtpAddress ($_.split(","))[3] -EmailAddressPolicyEnabled $false
set-user -identity ($_.split(","))[1] -Department ($_.split(","))[4]
}
gc mailbox.csv | foreach {Addmailbox}
1. 将Pass@word 替换成你们用户的默认密码
2. 将"OU=mail,DC=RES,DC=Contoso,DC=COM"替换成你们的用户OU
3. 将"nj-9l-dc-01.CORP.Contoso.COM" 替换成你们的AD Server名
mailbox.csv内容如下
Chao,Ting | CHAOT@CORP.Contoso.COM | RES-MB-M-01MB1 | chaot@Contoso.com | HR |
Chen,Jiemin | CHENJM@CORP.Contoso.COM | RES-MB-M-01MB1 | chenjm@Contoso.com | HR |
Guan,Jian | GUANJ@CORP.Contoso.COM | RES-MB-M-01MB1 | guanj@Contoso.com | IST |
Guo,Hong | GUOH@CORP.Contoso.COM | RES-MB-M-01MB1 | guoh@Contoso.com | IST |
文件说明
通过Excel将mailbox.csv 文件打开
第一列是用户的显示名称
第二列是用户的UPN
第三列是用户Exchange服务器邮箱数据库的名称
第四列是用户的邮件地址
第五列是用户的部门
本文来自:http://blog.sina.com.cn/s/blog_7ce5ba880100ta1l.html
部署Exchange2010 数据库和应用全冗余(NLB,CAS ARRAY阵列,DAG高
导读:再买了两台服务器,这样子可以实现双前端和双数据库,因为微软不建议前端负载均衡和邮箱故障转移群集在同一台机器上。
CAS,DAG高可用组,
作者:管理员
推荐内容 Recommended
- 江苏飞浩信息科技期待您的加入07-20
- 江苏飞浩科技欢迎您07-19
相关内容 Related
- 江苏飞浩信息科技期待您的加入07-20
- 江苏飞浩科技欢迎您07-19