A company I worked for had been using a 3rd party tool to manage rooms and resources and decided to move all their rooms to Exchange. Great decision, as it makes sense to take advantage of Exchange and Outlook's integrated calendaring. Why pay extra to manage rooms scheduling when Exchange does it so well?
I found myself needing to make hundreds of rooms for multiple locations across the globe - time for PowerShell and the Exchange Management Shell! These scripts were written for Exchange 2010 but they would work in newer versions of on-premise Exchange and Exchange 365 as well.
1. Fill out the csv file with your room information for as many rooms as you need to make. Save the file to C:\scripts or wherever you like and edit the script to reflect the new location.
2. Save the following as roomsfromcsv.ps1. Tip: It's usually a good idea to paste the script into a text editor and then save as your .ps1 file to get rid of any weird formatting.
Import-CSV “C:\scripts\rooms.csv” | foreach {new-mailbox –Name $_.name -DisplayName $_.DisplayName –Alias $_.alias –OrganizationalUnit $_.organizationalunit –UserPrincipalName $_.userprincipalname –SamAccountName $_.SamAccountName –Database $_.Database –Office $_.Office –Phone $_.Phone –ResourceCapacity $_.ResourceCapacity -room}
3. This second script turns on the Room Attendant feature that allows the room to accept or decline meetings. I call this one setattendantfromcsv.ps1. Tip: Wait a few minutes before you run this one as there is some processing that needs to occur on the new rooms before it will run successfully.
Import-CSV “C:\scripts\rooms.csv” | foreach {Set-CalendarProcessing -Identity $_.alias -AutomateProcessing AutoAccept}
4. Open Exchange Management Shell and cd to c:\scripts. Then run the script by typing .\roomsfromcsv.ps1. Wait a few minutes and then run the second script setattendantfromcsv.ps1.
Congratulation, you just made a bunch of rooms.
Comments
You can follow this conversation by subscribing to the comment feed for this post.