E14–Bulk Create Contacts

 

http://howdouc.blogspot.tw/2010/06/bulk-importcreate-mail-enabled-contacts.html

http://msexchangeguru.com/2012/11/16/contacts-in-bulk/

 

image

[PS] C:\>$csvinfo = Import-Csv ABC.csv

建立MailContact

[PS] C:\>foreach ($line in $csvinfo) {New-MailContact -Name $line.name -ExternalEmailAddress $line.Em
ailAddress -LastName $line.LastName -DisplayName $line.DisplayName -Alias $line.Alias -OrganizationalUnit ABC_OU}

 

更新contact 的phone 資訊  (要從contact 更新,非MailContact)

[PS] C:\>foreach ($line in $csvinfo) {Get-Contact -Identity "$($line.DisplayName)" | Set-Contact -Pho
ne "$($Line.BusinessPhone)"}

更新中文姓名 (csv 轉存 utf-8)

[PS] C:\>foreach ($line in $csvinfo) {Get-Contact -Identity "$($line.DisplayName)" | Set-Contact -Las
tName "$($Line.LastName)"}

Comments

Popular posts from this blog

E15 CU3–Update Failed–AD replicated Exceeded the tombstone lifetime.

202301 - Exchange onpreme - PowerShell Serialization Payload Signing

E14–Bulk Create Mail Contact & Set-Contact