Script for Conference Room Conversion

We often receive a request in daily job in messaging environment with regards to conference room. We might receive a request to convert an existing conference room from auto accept to delegate and vice versa.

It could be easier if there is a script to change the room type for these kind of bulk requests . Below script can be used for converting the conference room types. The Script configures conference rooms for Auto Accept or delegate configuration according to the input given.

You can use the below script for conference room conversion

***********************************************************************

<#

.SYNOPSIS

SetConferenceRoom.ps1 configures conference rooms for AutoAccept or delegate configuration.

 

.DESCRIPTION

Rooms are configured as AutoAccept room or delegate room using the parameters defined below. Both types are converted to the RoomMailbox recipient type if they are not already. This is a one-way operation.

 

If configured as an AutoAccept room, no resource delegates are set and the AllBookIn and AllRequestIn policies are left at true with AutoAccept processing turned on.

 

If configured as a delegate room, the AllBookIn policy is set to false. At least one delegate must be supplied in the syntax described below, and will be configured on the room. Delegates can be added to rooms as part of this script, and delegates cannot be removed. It will only take the existing delegate list and add to it.

 

.PARAMETER Room

The CDSID, DN or LegacyDN of the room to configure. Quote if necessary.

 

.PARAMETER AutoAccept

Boolean parameter to define whether AutoAccept is on or off. If set to $true, then -Delegates must not be used.

 

.PARAMETER Delegates

An array of delegates to add to the room. Specify multiple delegates using a comma, and quote individual delegates.

 

.INPUTS

None – no pipeline input.

 

.OUTPUTS

System.String.

 

.EXAMPLE

C:\PS>.\SetConferenceRoom.ps1 -Room NARoom100 -AutoAccept:$true

Room is configured as a RoomMailbox if not already, and all AutoAccept settings are configured. Delegates are not configured.

 

.EXAMPLE

C:\PS>.\SetConferenceRoom.ps1 -Room NARoom100 -AutoAccept:$false -Delegates userid1

Room is configured as a RoomMailbox if not alreayd, and all delegate settings are configured. Delegate userid1 is added to the existing list, empty or not.

 

.EXAMPLE

C:\PS>.\SetConferenceRoom.ps1 -Room NARoom100 -AutoAccept:$false -Delegates “userid1″,”userid2”

Room is configured as a RoomMailbox if not alreayd, and all delegate settings are configured. Delegates userid1 and userid2 are added to the existing list, empty or not.

 

.LINK

Insert script documentation link here.

#>

Param([string]$Room,[bool]$AutoAccept = $false,[Array]$Delegates = $null)

 

if (($AutoAccept -eq $false) -and ($Delegates -eq $null))

{

write-host “Cannot configure room as a delegate room without a delegate list. Please see ‘help .\SetConferenceRoom.ps1 -detailed’ for more information.”

exit

}

if (($AutoAccept -eq $true) -and ($Delegates -ne $null))

{

write-host “Cannot configure room as an AutoAccept room WITH delegates. Please see ‘help .\SetConferenceRoom.ps1 -detailed’ for more information.”

exit

}

try

{

write-host (“`r`nValidating mailbox `”$room`”…”) -ForegroundColor white

$d = Get-mailbox $Room -erroraction Stop

}

Catch

{

write-host (“`r`nCannot find mailbox `”$room`”. Reason: ” + $Error[0]) -ForegroundColor white

write-host `r`n”Exiting…”

exit

}

$RecType = (get-mailbox $room).RecipientTypeDetails.ToString()

write-host “`r`nConverting $room to recipient type RoomMailbox…” -ForegroundColor white

if ($RecType -ne “RoomMailbox”)

{

$answer = read-host -Prompt “`r`nRoom About to convert $room to object type Room from $RecType. This is required in order to configure the conference room. Do you wish to continue? (y/n)”

if ($answer.ToString().Tolower() -eq “y”)

{

set-mailbox $room -type Room

write-host “`r`nConfigured $room as recipient type RoomMailbox.”

}

else

{

write-host “`r`nOperation aborted. No longer processing room conversion.”

}

}

else

{

write-host “$room is already of type RoomMailbox. Skipping conversion…”

}

if ($AutoAccept -eq $true)

{

write-host “`r`nChecking room for existing delegates…” -ForegroundColor white

$currentdelegates = @()

$currentdelegates += (get-calendarprocessing $room).resourcedelegates

if ($currentdelegates.Count -gt 0)

{

write-host “`r`n$Room has the following delegates:”

$currentdelegates |select name

write-host “`r`nThese delegates should be cleared if the room is to be configured as AutoAccept.”

$answer = Read-Host “Do you wish to clear these delegates from the room? (y/n)”

if ($answer.tostring().tolower() -eq “y”)

{

set-calendarprocessing $Room -ResourceDelegates $null

write-host “Cleared delegates on $room.”

}

else

{

write-host “Not clearing delegates on $room.”

}

}

else

{

write-host “`r`n$Room has no existing delegates. Skipping warnings…”

}

write-host “`r`nConfiguring calendar processing on $room…” -ForegroundColor white

set-calendarprocessing $room -TentativePendingApproval:$true -OrganizerInfo:$false -additionalresponse “This meeting had the Subject, Comments and Attachments removed. This meeting is not public and should be treated as private.” -AddNewRequestsTentatively:$false -AutomateProcessing AutoAccept -BookingWindowInDays 365 -ForwardRequestsToDelegates:$false -AddOrganizerToSubject:$false -AddAdditionalResponse:$true -AllRequestInPolicy:$true -AllBookInPolicy:$true

write-host “`r`nConfigured calendar processing on $room for standard AutoAccept configuration.”

}

else

{

write-host “`r`nSetting delegate configuration on $room…” -ForegroundColor white

$currentdelegates = @()

$currentdelegates += (get-calendarprocessing $room).resourcedelegates

if ($currentdelegates.count -gt 0)

{

write-host “`r`n$room currently has these delegates:”

$currentdelegates |select Name

write-host “`r`nThe following delegates will replace the existing list:”

$delegates

$answer = read-host -prompt “`r`nIf you do not wish to proceed, delegates will not be added but proocessing options will still be confgured as a delegate room. Delegates can be added later. `r`nAlso, if there are any users in the list of additions that are already delegates, do not proceed and remove the duplicates from the list. `r`nDo you wish to proceed? (y/n)”

if ($answer.ToString().ToLower() -eq “y”)

{

Set-CalendarProcessing $room -ResourceDelegates $null

set-calendarprocessing $room -resourcedelegates $delegates

write-host “Delegates configured. These may not appear in the properties of $room for a few minutes.”

}

else

{

write-host “Skipping delegate configuration.”

}

}

else

{

write-host “`r`n$Room currently has no delegates. Adding these:”

$delegates

set-calendarprocessing $room -resourcedelegates $delegates

write-host “Delegates configured.”

}

write-host “`r`nConfiguring calendar processing on $room..” -ForegroundColor white

set-calendarprocessing $room -TentativePendingApproval:$true -OrganizerInfo:$false -additionalresponse “This meeting had the Subject, Comments and Attachments removed. This meeting is not public and should be treated as private.” -AddNewRequestsTentatively:$false -AllBookInPolicy:$false -AllRequestInPolicy:$true -AutomateProcessing AutoAccept -BookingWindowInDays 365 -ForwardRequestsToDelegates:$true  -AddOrganizerToSubject:$false -AddAdditionalResponse:$true

write-host “`r`nConfigured calendar processing on $room for standard delegate configuration.”

}

write-host “`r`n$room configuration complete.`r`n” -ForegroundColor white

***********************************************************************

Just download the script and navigate to the location through EMS

Run the below command to make it to delegate  type

.\conf.ps1 –Room   “roommbx” –AutoAccept:$false –Delegates “specify delegates”

Image

This script can be used to change the delegate of the conference room as well

Image

For auto accept

The below output is for autoaccept

Image

 

Cheers

Sathish Veerapandian

Technology Evangelist

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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: