Query on Room mailboxes

Glenn Maxwell 10,146 Reputation points
2023-06-01T06:04:14.21+00:00

Hi All

i have 50 rooms in the below csv format. Some rooms have booking policy, some dont have. i want to remove booking policy if any room has and also i want to unhide the rooms. i want to try the below syntax but i am not sure. please guide me.

rooms
room1@contoso.com
room2@contoso.com

$RoomList = import-csv C:\temp\input.csv
ForEach ($Rooms in $RoomList)
{
Set-CalendarProcessing -AutomateProcessing AutoAccept -AllBookInPolicy $True -BookInPolicy $null -AddAdditionalResponse $False -AdditionalResponse $Null
 }

Microsoft Exchange Online
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,175 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,349 questions
Microsoft Exchange Hybrid Management
Microsoft Exchange Hybrid Management
Microsoft Exchange: Microsoft messaging and collaboration software.Hybrid Management: Organizing, handling, directing or controlling hybrid deployments.
1,886 questions
0 comments No comments
{count} votes

Accepted answer
  1. Dezhi Li-MSFT 780 Reputation points
    2023-06-02T06:43:14.7533333+00:00

    Hi Glenn Maxwell

    Please change $rooms in the script to $rooms.rooms. $rooms is an object and cannot be used directly as a parameter.

    Please try:

    $RoomList = import-csv C:\temp\input.csv 
    ForEach ($Rooms in $RoomList) 
    { Set-CalendarProcessing -Identity $rooms.rooms -AutomateProcessing AutoAccept -AllBookInPolicy $True -BookInPolicy $null -AddAdditionalResponse $False -AdditionalResponse $Null }
    
    

    Best Regards,

    Dezhi


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation](https://aka.ms/msftqanotifications)"https://aka.ms/msftqanotifications)") to enable e-mail notifications if you want to receive the related email notification for this thread.  

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Vasil Michev 95,341 Reputation points MVP
    2023-06-01T07:43:51.78+00:00

    You're not referencing the room identity, use something like this instead:

    ForEach ($Rooms in $RoomList)
    {
    Set-CalendarProcessing -Identity $rooms -AutomateProcessing AutoAccept -AllBookInPolicy $True -BookInPolicy $null -AddAdditionalResponse $False -AdditionalResponse $Null
     }
    
    0 comments No comments

  2. Glenn Maxwell 10,146 Reputation points
    2023-06-01T21:05:52.5366667+00:00
    $RoomList = import-csv C:\temp\input.csv
    ForEach ($Rooms in $RoomList) { Set-CalendarProcessing -Identity $rooms -AutomateProcessing AutoAccept -AllBookInPolicy $True -BookInPolicy $null -AddAdditionalResponse $False -AdditionalResponse $Null }
    
    i am getting below error
    Write-ErrorMessage : Parameter values of type Microsoft.Exchange.configuration.Tasks.GeneralRecipientIdParameter can't be empty