Managing dedicated Rooms

Managing dedicated Rooms

roualin ex-mgmt-shell1 Managing dedicated RoomsHere are some commands to use to manage Dedicated Room mailboxes.

Dedicated Rooms can also be scheduled by some restricted people.

Getting delegates list :

$GetDelegates=(Get-MailboxCalendarSettings “$Room”).ResourceDelegates

Setting Delegates :

$Mbx=Get-Mailbox “$Room”
$Mbx|Set-MailboxCalendarSettings -ResourceDelegate $Delegates
$Delegates is an Array value

Remove a delegate :

$Mbx=Get-Mailbox “$Room”
$delDelegate <- SAM of the delegate to remove
$NewDelegates=($Mbx|
Get-ADPermission |
Where-Object {-not $_.isinherited} |
Where-Object {$_.user -match “^DOMAIN”}|
ForEach-Object {
If(($_.User.ToString().split(“/”)[1]) –ne $delDelegate){
$_.User.ToString().split(“/”)[1]
}
}
)
$Mbx|Set-MailboxCalendarSettings -ResourceDelegate $NewDelegates

Add a delegate :

$Mbx=Get-Mailbox “$Room”
$DelegateToAdd <- SAM of the delegate to add
$NewDelegates=($Mbx|
Get-ADPermission |
Where-Object {-not $_.isinherited} |
Where-Object {$_.user -match “^DOMAIN”}|
ForEach-Object {
If(($_.User.ToString().split(“/”)[1]) –ne $delDelegate){
$_.User.ToString().split(“/”)[1]
}
}
)
$NewDelegates += $DelegateToAdd
$Mbx|Set-MailboxCalendarSettings -ResourceDelegate $NewDelegates

Get a manager of a dedicated room :

$Mbx=Get-Mailbox “$Room”
$Manager=(get-user $Mbx).Manager

 Modify a Manager :

Function Remove_Old_Mgr ([string]$Upn, [string]$Nom, [string]$Responsible ) {
$domainResponsible=$RespDomain + ” + $Responsible
Remove-MailboxPermission -Identity $UPN `
-AccessRights FullAccess `
-User $Responsible `
-DomainController $Controller
Remove-ADPermission -Identity “$($Nom)” `
-AccessRights ReadProperty `
-User $DOMAINResponsible `
-DomainController $Controller
Remove-ADPermission -Identity “$($Nom)” `
-AccessRights WriteProperty `
-User $DOMAINResponsible `
-DomainController $Controller
}

Function Set_New_Mgr ([string]$Upn, [string]$Nom, [string]$Responsible) {
$DOMAINResponsible=$RespDomain + ” + $Responsible
Add-MailboxPermission -Identity $UPN `
-AccessRights FullAccess `
-User $Responsible `
-DomainController $Controller
Add-ADPermission -Identity “$($Nom)” `
-AccessRights ReadProperty `
-User $DOMAINResponsible `
-DomainController $Controller
Add-ADPermission -Identity “$($Nom)” `
-AccessRights WriteProperty `
-User $DOMAINResponsible `
-DomainController $Controller
}

$Mbx=Get-Mailbox “$Room”
remove_old_mgr $Mbx.UserPrincipalName $Mbx.Name $Manager
$Mbx | Set-User -Manager $NewManager
set_new_mgr $Mbx.UserPrincipalName $Mbx.Name $NewManager

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

How to whitelist website on AdBlocker?

How to whitelist website on AdBlocker?

  1. 1 Click on the AdBlock Plus icon on the top right corner of your browser
  2. 2 Click on "Enabled on this site" from the AdBlock Plus option
  3. 3 Refresh the page and start browsing the site