-----提供AD\Exchange\Lync\Sharepoint\CRM\SC\O365等微软产品实施及外包,QQ:185426445.电话18666943750

用户需要批量导入邮箱,提供的信息,如姓名、别名、组织单元、显示名、登录名、密码、公司名、部门、邮箱配额,表格如下图

wKioL1c0q_GhJv1vAAGHVYX5B24414.png

步骤1、在powershell中输入如下命令:

Add-PSSnapin microsoft.exchange*
Import-Module activedirectory
Import-Csv C:\mbxinfo.csv | ForEach-Object `
{
new-mailbox -Name $_.name -Alias $_.alias -OrganizationalUnit $_.ou -DisplayName $_.displayname -UserPrincipalName $_.upn `
-Password (ConvertTo-SecureString -String $_.pwd -AsPlainText -Force)
set-mailbox -Identity $_.upn -IssueWarningQuota $_.IssueWarningQuota -ProhibitSendQuota $_.ProhibitSendQuota `
-ProhibitSendReceiveQuota $_.ProhibitSendReceiveQuota -UseDatabaseQuotaDefaults $false
Set-User -Identity $_.upn -Company $_.company -Department $_.dept
}
wKioL1c0rZSwC4NlAAEr4oGDU1E156.png

步骤2、我们检查,可以看到邮箱和ad账号都已经批量建好

wKioL1c0rhyQymLdAACzlbqAcAc399.png

wKiom1c0rXHAMBy9AABV4_j7RxA800.png