Forum Discussion

tyagia2ul's avatar
tyagia2ul
Copper Contributor
Mar 03, 2022
Solved

How to Add / Remove user in existing BookInPolicy In O365 through PowerShell

Hello ,

 

I have a Book In Policy for meeting rooms and i need to add and remove users to the existing policy. I have created the policy using the below command

 

Get-Mailbox BoardRoom | Set-CalendarProcessing -AllBookInPolicy:$false -AllRequestInPolicy:$false -BookInPolicy "Email address removed","Email address removed","Email address removed"

 

But when i am running the command to add/remove users it over write the existing policy. I tried the below and it did not work

 

Set-CalendarProcessing -Identity "Room9" -BookInPolicy "Email address removed", "Email address removed"

 

Any help would be appreciated.

 

Thanks,

Atul

5 Replies

  • tyagia2ul 

     

    You're replacing it instead of adding it, this is a nice function to add users

     

    http://serverocean3.blogspot.com/2015/02/add-user-in-bookinpolicy.html

     

    function Add-CalendarResourceDelegate {
    Param(
    $RoomName
    , $newDelegate
    )
    $resourceDelegates = (Get-CalendarProcessing -Identity $RoomName).ResourceDelegates
    $resourceDelegates += $newDelegate
    Set-CalendarProcessing -Identity $RoomName -ResourceDelegates $resourceDelegates
    }
    

    CMD syntax:

    Add-CalendarResourceDelegate -Identity $Roomname "Email address removed" -newDelegate UserID9


    To Remove All Users from ResourceDelegate:

    Set-CalendarProcessing -Identity "Email address removed" -ResourceDelegates $null

Resources