通过Exchange 的 Powershell批量创建AD账户和邮箱
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(','))new-mailbox -OrganizationalUnit $Oupath -name ($_.split(",")) -password $password -LinkedDomainController "nj-9l-dc-01.CORP.Contoso.COM" -LinkedMasterAccount ($_.split(",")) -UserPrincipalName ($_.split(",")) -LinkedCredential $s -DisplayName ($_.split(",")) -database ($_.split(","))set-mailbox -identity ($_.split(",")) -PrimarySmtpAddress ($_.split(",")) -EmailAddressPolicyEnabled $falseset-user -identity ($_.split(",")) -Department ($_.split(","))}gc mailbox.csv | foreach {Addmailbox}1. 将Pass@word 替换成你们用户的默认密码2. 将"OU=mail,DC=RES,DC=Contoso,DC=COM"替换成你们的用户OU3. 将"nj-9l-dc-01.CORP.Contoso.COM" 替换成你们的AD Server名mailbox.csv内容如下Chao,TingCHAOT@CORP.Contoso.COMRES-MB-M-01\MB1chaot@Contoso.comHRChen,JieminCHENJM@CORP.Contoso.COMRES-MB-M-01\MB1chenjm@Contoso.comHRGuan,JianGUANJ@CORP.Contoso.COMRES-MB-M-01\MB1guanj@Contoso.comISTGuo,HongGUOH@CORP.Contoso.COMRES-MB-M-01\MB1guoh@Contoso.comIST 文件说明
通过Excel将mailbox.csv 文件打开
第一列是用户的显示名称
第二列是用户的UPN
第三列是用户Exchange服务器邮箱数据库的名称
第四列是用户的邮件地址
第五列是用户的部门
页:
[1]