-----提供AD\Exchange\Lync\Sharepoint\CRM\SC\O365等微软产品实施及外包,QQ:185426445.电话18666943750
用户需要批量导入邮箱,提供的信息,如姓名、别名、组织单元、显示名、登录名、密码、公司名、部门、邮箱配额,表格如下图
步骤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
}
步骤2、我们检查,可以看到邮箱和ad账号都已经批量建好