Exchange 2010에서 New-MailContact를 사용하여 연락처를 한꺼번에 여러개 생성하기


1) 다음과 같이 C:\customers.csv라는 파일을 생성한다.
Name, Email, OUPath
Yongshik Lee, jesuswithme@gmail.com, powershell.kr/customers/Samsung
Pyeonghwa Lee, peace@hotmail.com, powershell.kr/customers/LG
** 사전에 AD에서 Customers OU 아래에 각각 Samsung, LG OU를 생성해두어야 한다.

2) 다음과 같이 CreateContacts,ps1 파일을 생성하여 실행한다.
Import-CSV C:\customers.csv | ForEach-Object {
New-MailContact -ExternalEmailAddress $_.Email -Name $_.Name -OrganizationalUnit $_.OUpath
}

** 여기서 알 수 있듯이 무엇보다도 csv 파일을 잘 만든 것이 중요하다.
** 일단 기본적인 정보를 가지고 만든 후, 나머지 속성들은 나중에 수정해 넣으면 된다.

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s