# # add_rooms.ps1 # # Written by Carol Wapshere, September 2008 # # Use to create one or more room accounts, which are created disabled, and must be # managed by other users. # # Instructions: # #Â Â 1. Modify the add_rooms.csv file to include information about the accounts to add. #Â Â Â Â Â The file must have a header row and must include the following fields: #Â Â Â Â Â Â Â Â Â Â Â dn,UID,displayName,surname,givenName,password,alias,description,UPN # #Â Â 2. Open the Exchange Management Shell # #Â Â 3. CD to C:\scripts and run add_rooms.ps1.
cat add_rooms.csv > unicode.csv # make utf8
import-csv unicode.csv | foreach {
write-host $_.displayName $secureString = ConvertTo-SecureString $_.password -AsPlainText –Force
New-Mailbox -Room -Name $_.displayName -displayName $_.displayName -Alias $_.alias -OrganizationalUnit 'bbhfgg.local/BBH/Users' -UserPrincipalName $_.UPN -SamAccountName $_.UID -FirstName $_.givenName -Initials '' -LastName $_.surname -Database 'MEXBBH01\First Storage Group\Mailbox Database' -password $secureString -ResetPasswordOnNextLogon $false
} | out-file -filepath "c:\scripts\add_rooms.log" -encoding "UNICODE"