title: Powershell - SetMailboxFolderPermission only if AccessRights Not equal Reviewer
body: <p>I'd like to make a script to set the access rights for everyone as "Reviewer" on the calendar of some users, members of an specific AD group.</p>
  
  <p>I've already made a script which works weel to do that for all members of this group.
  I'd just want to make it a little smarter.</p>
  
  <p>I'd like to schedule this script to run automatically once a week and to only apply on mailboxes on which accessrights are not already set as "Reviewer" for everyone.</p>
  
  <p>Something like that :</p>
  
  <pre><code>$comm = Get-ADGroupMember GG_CalendarPermission-Reviewer | select -ExpandProperty name
  $GetCalendar = Get-mailboxfolderpermission -identity $user":\calendar" -user default
  
  foreach ($user in $comm) {    
    if ($GetCalendar.AccessRights -ne "Reviewer") {
         set-mailboxfolderpermission -identity $user":\calendar" -user Default -accessrights reviewer
    }
    elseif($GetCalendar.AccessRights -eq "Reviewer") {
         Write-Host "ALREADY DONE"
    }    
  }
  </code></pre>
  
  <p>But the "if/Elseif" doesn't seems to work :/ 
  Could you help me please ?</p>
  
  <p>Thanks.</p>