테스트용: 루프 돌면서 메일박스 생성하는 예제
$DOMAIN='pnplab.net'
for ($i = 1; $i -lt 16; $i++) {
$NAME='mstest'+$i.ToString("00")
New-Mailbox -DisplayName "$NAME" -Name "$NAME" -Alias "$NAME" -UserPrincipalName "${NAME}@${DOMAIN}" -SamAccountName "$NAME" `
-Password (ConvertTo-SecureString -AsPlainText "password1!" -Force) `
-ResetPasswordOnNextLogon $false
}
New-Mailbox -UserPrincipalName "C60_CONF1@${DOMAIN}" -Alias C60_CONF1 -Name C60_CONF1 -Room -ResetPasswordOnNextLogon $true
New-Mailbox -UserPrincipalName "C60_CONF2@${DOMAIN}" -Alias C60_CONF2 -Name C60_CONF2 -Room -ResetPasswordOnNextLogon $true
New-Mailbox -UserPrincipalName "C60_A10_CONF1@${DOMAIN}" -Alias C60_A10_CONF1 -Name C60_A10_CONF1 -Room -ResetPasswordOnNextLogon $true
New-Mailbox -UserPrincipalName "C60_A20_CONF1@${DOMAIN}" -Alias C60_A20_CONF1 -Name C60_A20_CONF1 -Room -ResetPasswordOnNextLogon $true
New-Mailbox -UserPrincipalName "US_C60_CONF1@${DOMAIN}" -Alias US_C60_CONF1 -Name US_C60_CONF1 -Room -ResetPasswordOnNextLogon $true
New-Mailbox -UserPrincipalName "EU_C60_CONF1@${DOMAIN}" -Alias EU_C60_CONF1 -Name EU_C60_CONF1 -Room -ResetPasswordOnNextLogon $true
New-Mailbox -UserPrincipalName "C01_CONF1@${DOMAIN}" -Alias C01_CONF1 -Name C01_CONF1 -Room -ResetPasswordOnNextLogon $true
New-Mailbox -UserPrincipalName "C01_A01_CONF1@${DOMAIN}" -Alias C01_A01_CONF1 -Name C01_A01_CONF1 -Room -ResetPasswordOnNextLogon $true
New-Mailbox -UserPrincipalName "US_C01_CONF1@${DOMAIN}" -Alias US_C01_CONF1 -Name US_C01_CONF1 -Room -ResetPasswordOnNextLogon $true
New-Mailbox -UserPrincipalName "EU_C01_CONF1@${DOMAIN}" -Alias EU_C01_CONF1 -Name EU_C01_CONF1 -Room -ResetPasswordOnNextLogon $true
New-DistributionGroup -Name C60_Org1 -Type Distribution
New-DistributionGroup -Name C60_Org2 -Type Distribution
New-DistributionGroup -Name C60_A10 -Type Distribution
New-DistributionGroup -Name C60_A20 -Type Distribution
New-DistributionGroup -Name C60_CUST1 -Type Distribution
New-DistributionGroup -Name C60_CUST2 -Type Distribution
New-DistributionGroup -Name C60_Hightech -Type Distribution
New-DistributionGroup -Name C60_Public -Type Distribution
New-DistributionGroup -Name C60_Finance -Type Distribution
New-DistributionGroup -Name C60_SCHQ -Type Distribution
New-DistributionGroup -Name C60_EduTeam -Type Distribution
New-DistributionGroup -Name US_C60_Org1 -Type Distribution
New-DistributionGroup -Name US_C60_Org2 -Type Distribution
New-DistributionGroup -Name EU_C60_Org1 -Type Distribution
New-DistributionGroup -Name US_C01_Org1 -Type Distribution
New-DistributionGroup -Name EU_C01_Org1 -Type Distribution
New-DistributionGroup -Name C01_Org1 -Type Distribution
New-DistributionGroup -Name C01_A01 -Type Distribution
Get-DistributionGroup -Identity "*C60*" | Set-DistributionGroup -CustomAttribute4 "C60" -CustomAttribute7 "ORG"
Get-DistributionGroup -Identity "*C01*" | Set-DistributionGroup -CustomAttribute4 "C01" -CustomAttribute7 "ORG"
Get-DistributionGroup -Identity "*_A10*" | Set-DistributionGroup -CustomAttribute9 "A10" -CustomAttribute8 "KR" -CustomAttribute7 "CUST"
Get-DistributionGroup -Identity "*_A20*" | Set-DistributionGroup -CustomAttribute9 "A20" -CustomAttribute8 "KR" -CustomAttribute7 "CUST"
Get-DistributionGroup -Identity "*_A01*" | Set-DistributionGroup -CustomAttribute9 "A01" -CustomAttribute8 "KR" -CustomAttribute7 "CUST"
Get-DistributionGroup -Identity "US*" | Set-DistributionGroup -CustomAttribute8 "US"
Get-DistributionGroup -Identity "EU*" | Set-DistributionGroup -CustomAttribute8 "EU"
Get-Mailbox -Identity "*C60*" -RecipientTypeDetails RoomMailbox | Set-Mailbox -CustomAttribute4 "C60" -CustomAttribute7 "CONF"
Get-Mailbox -Identity "*C01*" -RecipientTypeDetails RoomMailbox | Set-Mailbox -CustomAttribute4 "C01" -CustomAttribute7 "CONF"
Get-Mailbox -Identity "*_A10*" -RecipientTypeDetails RoomMailbox | Set-Mailbox -CustomAttribute9 "A10" -CustomAttribute8 "KR"
Get-Mailbox -Identity "*_A20*" -RecipientTypeDetails RoomMailbox | Set-Mailbox -CustomAttribute9 "A20" -CustomAttribute8 "KR"
Get-Mailbox -Identity "*_A01*" -RecipientTypeDetails RoomMailbox | Set-Mailbox -CustomAttribute9 "A01" -CustomAttribute8 "KR"
Get-Mailbox -Identity "US*" -RecipientTypeDetails RoomMailbox | Set-Mailbox -CustomAttribute8 "US"
Get-Mailbox -Identity "EU*" -RecipientTypeDetails RoomMailbox | Set-Mailbox -CustomAttribute8 "EU"
Add-DistributionGroupMember -Identity C60_Org1 -Member thermidor
Add-DistributionGroupMember -Identity C60_Org2 -Member mstest01
Add-DistributionGroupMember -Identity C60_Hightech -Member mstest02,mstest03
Add-DistributionGroupMember -Identity C60_Public -Member mstest04
Add-DistributionGroupMember -Identity C60_Finance -Member mstest05
Add-DistributionGroupMember -Identity C60_SCHQ -Member mstest06
Add-DistributionGroupMember -Identity C60_EduTeam -Member mstest07
'Tech: > Server·IIS' 카테고리의 다른 글
EMS-Powershell: Retention 정책 바로 반영하기 (0) | 2013.07.04 |
---|---|
EMS-Powershell: OWA에서 사용자ID로만 로그인하기 (0) | 2013.07.04 |
Powershell 문자열에 변수 사용 팁 (0) | 2013.06.30 |
Powershell로 IP주소, DNS 바꾸기 (0) | 2013.06.30 |
Exchange 2010/2013에서 첨부파일 차단 풀기 (0) | 2013.05.28 |