SOLVED

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

%3CLINGO-SUB%20id%3D%22lingo-sub-3243917%22%20slang%3D%22en-US%22%3EHow%20to%20Add%20%2F%20Remove%20user%20in%20existing%20BookInPolicy%20In%20O365%20through%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3243917%22%20slang%3D%22en-US%22%3E%3CP%20class%3D%22%22%3EHello%20%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22%22%3EI%20have%20a%20Book%20In%20Policy%20for%20meeting%20rooms%20and%20i%20need%20to%20add%20and%20remove%20users%20to%20the%20existing%20policy.%20I%20have%20created%20the%20policy%20using%20the%20below%20command%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22%22%3EGet-Mailbox%20BoardRoom%20%7C%20Set-CalendarProcessing%20-AllBookInPolicy%3A%24false%20-AllRequestInPolicy%3A%24false%20-BookInPolicy%20%22Email%20address%20removed%22%2C%22Email%20address%20removed%22%2C%22Email%20address%20removed%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20when%20i%20am%20running%20the%20command%20to%20add%2Fremove%20users%20it%20over%20write%20the%20existing%20policy.%20I%20tried%20the%20below%20and%20it%20did%20not%20work%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESet-CalendarProcessing%20-Identity%20%22Room9%22%20-BookInPolicy%20%22Email%20address%20removed%22%2C%20%22Email%20address%20removed%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20help%20would%20be%20appreciated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EAtul%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3243917%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3244735%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20Add%20%2F%20Remove%20user%20in%20existing%20BookInPolicy%20In%20O365%20through%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3244735%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1082534%22%20target%3D%22_blank%22%3E%40tyagia2ul%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou're%20replacing%20it%20instead%20of%20adding%20it%2C%20this%20is%20a%20nice%20function%20to%20add%20users%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22http%3A%2F%2Fserverocean3.blogspot.com%2F2015%2F02%2Fadd-user-in-bookinpolicy.html%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fserverocean3.blogspot.com%2F2015%2F02%2Fadd-user-in-bookinpolicy.html%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3Efunction%20Add-CalendarResourceDelegate%20%7B%0AParam(%0A%24RoomName%0A%2C%20%24newDelegate%0A)%0A%24resourceDelegates%20%3D%20(Get-CalendarProcessing%20-Identity%20%24RoomName).ResourceDelegates%0A%24resourceDelegates%20%2B%3D%20%24newDelegate%0ASet-CalendarProcessing%20-Identity%20%24RoomName%20-ResourceDelegates%20%24resourceDelegates%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3ECMD%20syntax%3A%3C%2FP%3E%3CP%3EAdd-CalendarResourceDelegate%20-Identity%20%24Roomname%20%22Email%20address%20removed%22%20-newDelegate%20UserID9%3C%2FP%3E%3CP%3E%3CBR%20%2F%3ETo%20Remove%20All%20Users%20from%20ResourceDelegate%3A%3C%2FP%3E%3CP%3ESet-CalendarProcessing%20-Identity%20%22Email%20address%20removed%22%20-ResourceDelegates%20%24null%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3245190%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20Add%20%2F%20Remove%20user%20in%20existing%20BookInPolicy%20In%20O365%20through%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3245190%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1209009%22%20target%3D%22_blank%22%3E%40Harm_Veenstra%3C%2FA%3E%26nbsp%3B.%20Thanks%20for%20your%20response.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20will%20surely%20going%20to%20try%20this%20.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3245194%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20Add%20%2F%20Remove%20user%20in%20existing%20BookInPolicy%20In%20O365%20through%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3245194%22%20slang%3D%22en-US%22%3ELet%20us%20know%20the%20results%20%3A)%3C%2Fimg%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3248137%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20Add%20%2F%20Remove%20user%20in%20existing%20BookInPolicy%20In%20O365%20through%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3248137%22%20slang%3D%22en-US%22%3E%3CP%3EDid%20this%20work%20for%20you%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

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

@Harm_Veenstra . Thanks for your response. 

 

I will surely going to try this .

Did this work for you?

best response confirmed by tyagia2ul (New Contributor)
Solution
Please mark my answer as solution to mark it as solved