Powershell 是最好的方法。您可以运行计划任务,该任务对您的 ERP 进行数据库调用以查找任何新用户,或者您可以导出属性的 csv 以用于创建帐户。
在基本层面上,这是代码的框架:
$Data = Import-CSV "c:\path\to\datafile.csv"
foreach ($user in $data) {
$TargetOU = "OU=CompanySite,DC=example,DC=domain,DC=com" #Use this for where to create the Accounts
#Note: You need to either generate a random password or supply one via the import. I recommend random generation and then have the user set one when the arrive.
New-ADUser -SamAccountName $user.username -GivenName $user.FirstName -Surname $user.LastName -AccountPassword $password -Path $TargetOU -etc -etc -etc #You can set as many attributes as you'd like at creation
Sleep 10 #allow for propogation of account to all DCs
Enable-Mailbox -Identity $user.username -Alias $user.username -Database "only needed if you specify a database manually"
Set-Mailbox -etc -etc #use for anything that needs to be configured after the mailbox is enabled.
}