none
Default Calendar change to shared

    Question

  • Hi, can we set in Exchange 2010 the calendar default to be visible for everyone of the organisation. I mean, when creating a new mailbox, we need to set it seperately to be shared. Can we set this on organizational level? Any powershell command?
    Thanks.

    Thursday, March 11, 2010 6:53 AM

Answers

  • You can use a simple PS script to do it:

    ==================

    $password = Read-Host "Enter password" -AsSecureString

    New-Mailbox -UserPrincipalName chris@contoso.com -Alias chris -Database "Mailbox Database 1" -Name ChrisAshton -OrganizationalUnit Users -Password $password -FirstName Chris -LastName Ashton -DisplayName "Chris Ashton" -ResetPasswordOnNextLogon $True

    Add-MailboxFolderPermission -Identity chris@contoso.com:\Calendar -User Default -AccessRights Reviewer

    ==================

    Notes: You just need to change the variable in it


    James Luo
    TechNet Subscriber Support (http://technet.microsoft.com/en-us/subscriptions/ms788697.aspx)
    If you have any feedback on our support, please contact tngfb@microsoft.com
    • Marked as answer by ggoossens Friday, March 12, 2010 4:01 PM
    Friday, March 12, 2010 2:48 AM
    Moderator

All replies

  • Hi,
     You may have to use the ExFolder to achieve this.

    Plan:

    1. Open ExFolder. 
    2.Click File -> Connect. 
    3. Give Exchange Server name on which you want to set Calendar Read Permission for All Mailboxes & Global Catalog Server name. 
    4. Select All Mailboxes and Click OK. 
    5. You can see list of all mailboxes which are available on specified Exchange server. 
    6. You may verify existing calendar permission before our operation by expanding any of the mailbox -> Top of Information Store -> Calendar -> Right Click & Select Folder Permission. 
    7. Now, lets set the calendar permission for all mailboxes.
    8.Select the Mailboxes on top of all listed Mailboxes in Left pane. 
    9. Click Tools Menu -> Select Set Calendar Permissions. 
    10.Click OK when you get information dialog box “In the following folder permissions dialog, please configure the permissions you would like to set on the Calendar folders.” 
    11.New Permissions window opens, click Add. 
    12. New window opens to Choose user, click on Browse. 
    13.Select Everyone and click OK. 
    Note: When you open calendar permission in outlook, you can see Default None permission where default is Everyone.
    14.Edit (05/30/08): In Exchange/outlook – 2007 if permission is set to Free/Busy Time and you change it to reviewer which is full free/busy detail then later if you want to revert back to Free/Busy Time then that option is not available in ExFolder & need to set it at individual mailbox so make sure before doing change.
    15.Select the Permissions Reviewer, click OK. 
    16.You get an information dialog box, “You will now be represented with a permissions dialog you can use to select the entities that will be removed. The role for each entity has no effect. Any selected entities will be removed from Calendar permissions regardless of their roles.” 
    Click OK in below information dialog box. 

    As it has given information in previous information dialog box, you can add users if you want to remove permission from all mailboxes. (I would suggest, not to select any users until you are sure about that and you need to remove a user from all of mailboxes.) 
    Click OK. 

    Note: As ExFolder can be used to add as well as to remove calendar permission, you get this window to remove permission. Don’t misunderstood this window, if you give here Everyone Reviewer permission again to remove then you get below error.

    17. When you click OK in previous window, it starts giving permission to calendar of all mailbox. 
    Once it is finished you can see 100 in Percentage Completed then Close window. 
    18. You may verify in some of the mailbox that Everyone Reviewer permission set correctly on Calendar. 

    That’s all, now all users have permission to read calendar on any of the mailbox on this server.

    Ref to:
    FAQ: Give Calendar Read Permission on all Mailboxes – PFDavAdmin ( For E2K7)

    All the Best :)

    Sathish Kumar Elango | MCSE 2003 & MCSA Messaging | http://msexchangehelp.wordpress.com
    Thursday, March 11, 2010 7:31 AM
  • Thanks for your input !
    In fact, this procedure is ok for existing mailboxes.
    I was more looking for a 'policy' which implements this on every new created mailbox. Could it be that a powershell command for the whole organization sets calendar sharing per default? Does it exist?
    Thanks.
    Thursday, March 11, 2010 9:46 AM
  • Do you mean you want to share the calendar of every new user that you are going to create henceforth? It may be your internal requirement of course but I am curious to know why would you like to do that when the free busy information from every other mailbox is made available by default? What are you trying to do exactly?
    Milind Naphade | MCTS:M (Exchange 2007 and 2010) | http://www.msexchangegeek.com RSS Feed
    Thursday, March 11, 2010 9:59 AM
  • Indeed. It is standard policy into the company to have all calendars shared except exception... We discussed it thoroughly, but... as decided by the management. Free/busy (detailed or not) must be seen via a meeting request. Therefore...

    Thursday, March 11, 2010 2:57 PM
  • You can use a simple PS script to do it:

    ==================

    $password = Read-Host "Enter password" -AsSecureString

    New-Mailbox -UserPrincipalName chris@contoso.com -Alias chris -Database "Mailbox Database 1" -Name ChrisAshton -OrganizationalUnit Users -Password $password -FirstName Chris -LastName Ashton -DisplayName "Chris Ashton" -ResetPasswordOnNextLogon $True

    Add-MailboxFolderPermission -Identity chris@contoso.com:\Calendar -User Default -AccessRights Reviewer

    ==================

    Notes: You just need to change the variable in it


    James Luo
    TechNet Subscriber Support (http://technet.microsoft.com/en-us/subscriptions/ms788697.aspx)
    If you have any feedback on our support, please contact tngfb@microsoft.com
    • Marked as answer by ggoossens Friday, March 12, 2010 4:01 PM
    Friday, March 12, 2010 2:48 AM
    Moderator
  • Thanks, this will help creating/moving new users.
    Friday, March 12, 2010 4:01 PM
  • Would a script such as this work to modify all existing users calendar permissions? or would putting the :\Calendar on the end of the variable cause it to break?  I cannot get the ExFolders to work due to Ambiguous SID issues.

    $userAccounts = get-mailbox -resultsize unlimited

    ForEach ($user in $userAccounts)

    {

    add-MailboxPermission -identity $user:\Calendar -user Default -AccessRights Reviewer

    }

     

    Tuesday, August 24, 2010 10:10 PM
  • I am having a problem.

    When I set the permission for everyone (default) to 'Reviewer' it breaks the ability to see Free/Busy. The error given is Free/Busy not available.

    I need to have both FULL Free/Busy information available AND

    have the ability for every user to open any other user's calendar to view.

    Thanks.

    Wednesday, August 3, 2011 8:40 PM
  • I am having a problem.

    When I set the permission for everyone (default) to 'Reviewer' it breaks the ability to see Free/Busy. The error given is Free/Busy not available.

    I need to have both FULL Free/Busy information available AND

    have the ability for every user to open any other user's calendar to view.

    Thanks.

    I didn't read this thread in detail but maybe this will help (better late then never)...

    Get-mailbox | ForEach-Object { Set-MailboxFolderPermission -Identity $_":\Calendar" -User Default -AccessRights LimitedDetails }

    Thursday, February 16, 2012 5:41 PM
  • Hey Russ-ASID

    That is exactly what I am trying to do but I seem to get an error when I run that command.  Im running Exchange 2010 SP1. 

    For each one of my mailboxes I can this error and then this warning.  

    Pipeline not executed because a pipeline is already executing. Pipelines cannot be executed concurrently.

        + CategoryInfo          : OperationStopped: (Microsoft.Power...tHelperRunspace:ExecutionCmdletHelperRunspace) [],
       PSInvalidOperationException
        + FullyQualifiedErrorId : RemotePipelineExecutionFailed

    WARNING: The command completed successfully but no permissions of 'OUPath\Uername:\Calendar' have been modified.

    Any reason you can think of that would make this happen?

    Tuesday, February 21, 2012 1:15 AM
  • Just remember that ":\Calender" does not apply if the user has used another language in their client.

    Use the following to get the right calender-name:

    $MBX = Get-Mailbox $identity 
     
    $CalendarName = (Get-MailboxFolderStatistics -Identity $MBX.alias -FolderScope Calendar | Select-Object -First 1).Name 
    $folderID = $MBX.alias + ':\' + $CalendarName 

    Tuesday, August 21, 2012 1:32 PM
  • Dear all, as I learned and still continue to learn a lot from these MS Forums, I'd like to give you my own scripts you can use and modify at your discretion. They are all tested and I use them on our production Exchange 2010 Org (please note that there are commandlets available only on EX10, not available on EX07):

    #
    # script to check the permissions, users have set on their mailbox-calendars with Outlook
    #
    # THIS VERSION ONLY CHECKS FOR NONE PERMISSION in the DEFAULT user
    
    #NB. you can use the following commandlets:
    
    # Add-MailboxFolderPermission
    # Get-MailboxFolderPermission
    # Remove-MailboxFolderPermission
    # Set-MailboxFolderPermission
    
    # and these are the Permissions
    
    # None
    # Owner
    # PublishingEditor
    # Editor
    # PublishingAuthor
    # Author
    # NoneditingAuthor
    # Reviewer
    # Contributor
    # Custom
    # FreeBusyTimeOnly
    # FreeBusyTimeAndSubjectAndLocation
    
    # you can check also for LimitedDetails, FullDetails, AvailabilityOnly
    
    # we could also list all the permissions the users have set, see my other script
    # retrieveCalendarPermissionsOfAllUsers.ps1, as there are a lot of other users with individual permissions
    # e.g. ANONYMOUS and users chosen from the EX-Organisation
    #
    # the output can be redirected to a text-file in the given path or to the console
    # you may want to use the Export-CSV cmdlet if you prefer
    #
    #Custom variables
    
    #$mailboxes = Get-Mailbox -Database "yourExchangeServer_DB2" #set any desired DB here unless you want to call the script with parameters
    #use $Args to get an array of passed parameters
    
    #$mailboxes = Get-Mailbox -resultsize 40000 #if you want to limit the output for any reason
    #$mailboxes = Get-Mailbox -OrganizationalUnit yourAD.yourDomain.local/YourRootOu/yourDesiredOu #dito
    
    $mailboxes = Get-Mailbox -domaincontroller yourAD.yourDomain.local -OrganizationalUnit yourAD.yourDomain.local/YourRootOu/yourDesiredOu -resultsize unlimited | Where-Object {$_.primarysmtpaddress.length -ne 0 -and $_.ServerName -like "yourExServersYouWantHere*"} #you get only mailboxes of that OU and Servers with valid smtp addresses
    
    $outputToFile = $true #set it to $true to redirect the output into a text-file
    $pathToFile = "C:\temp\mailboxCalendarPermissionsDefaultUserNone.csv"
    $numberOfMailboxes = 0 #to count the number of mailboxes processed
    
    if ($outputToFile) {#write column-headers to file, as CSV-Standard and create new file
      [string]::Join(",",("mailbox.DisplayName", "mailbox.ServerName", "mailbox.PrimarySmtpAddress","mailbox.AccessRights")) | Out-File -filepath $pathToFile
    }
    
    #Loop through all mailboxes 
    foreach ($mailbox in $mailboxes) { 
      $numberOfMailboxes += 1 #count number of mailboxes
      
    #Retrieve name of the user`s calendar, independently of his own language selected.
    #I guess First 1 takes the shared calendar and not any other ones the users can create and name as they want
    #strangely in mailboxes where I created a second calendar First 2 retreaves still the first/system calendar
    #I had to issue this cmdlet to get a calendar I named secondCalendar
    #Get-MailboxFolderStatistics -Identity yourUserName -folderScope all | where-object {$_.folderpath -like "/second*"}
    #strangely enumerating all folders shows this folder type to be "user created" and not "calendar" which explains why it is not
    #retrieved by -FolderScope Calendar
    
      $calendar = (($mailbox.userPrincipalName)+ ":\" + (Get-MailboxFolderStatistics -Identity $mailbox.userPrincipalName -FolderScope Calendar | Select-Object -First 1).Name) 
     
    #write out all calendar permissions of DEFAULT USER
    
      $output = (Get-MailboxFolderPermission $calendar | Where-Object {$_.User -like "Default"}).AccessRights #you might filter on any possible users here, see my other script
       
      if ($outputToFile -and $output -eq "None") {#actually we are interested only in users with NONE permissions set, again you might filter on any other permissions here
      
        Write-Host "Retrieving calendar permission for $mailbox... and writing to text-file" -ForegroundColor Yellow
        $mailbox | Add-Member -membertype noteproperty -name AccessRights -value $output #combine properties for later output
    
        [string]::Join(",",($mailbox.DisplayName, $mailbox.ServerName, $mailbox.PrimarySmtpAddress, $mailbox.AccessRights)) | Out-File -append -NoClobber -filepath $pathToFile
    
      }
      else { #show all the mailboxes found on the console to get an overview, not only of those with NONE permissions set
      
    Write-Host "Retrieving calendar permission for $mailbox..." -ForegroundColor Yellow
        $mailbox | Add-Member -membertype noteproperty -name AccessRights -value $output #combine properties for later output
        $mailbox | ft DisplayName, ServerName, PrimarySmtpAddress, AccessRights
      }
    }
    
    Write-Host "Total number of mailboxes processed: $numberOfMailboxes" -ForegroundColor Yellow
    


    Rosario




    • Edited by Rosario2 Thursday, March 7, 2013 2:54 PM
    Thursday, March 7, 2013 2:39 PM
  • Next one to retrieve permissions of any user of a given calendar

    #
    # script to check ALL the permissions, users have set on their mailbox-calendars with Outlook
    
    #NB. you can use the following commandlets:
    
    # Add-MailboxFolderPermission
    # Get-MailboxFolderPermission
    # Remove-MailboxFolderPermission
    # Set-MailboxFolderPermission
    
    # and these are the Permissions
    
    # None
    # Owner
    # PublishingEditor
    # Editor
    # PublishingAuthor
    # Author
    # NoneditingAuthor
    # Reviewer
    # Contributor
    # Custom
    # FreeBusyTimeOnly
    # FreeBusyTimeAndSubjectAndLocation
    
    # we could also list all the permissions the users have set, see my other script
    # retrieveCalendarPermissionsOfAllUsers.ps1, as there are a lot of other users with individual permissions
    # e.g. ANONYMOUS and users chosen from the EX-Organisation
    #
    # the output can be redirected to a text-file in the given path or to the console
    # you may want to use the Export-CSV cmdlet if you prefer
    #
    #Custom variables
    
    $mailboxes = Get-Mailbox -domaincontroller yourAD.yourDomain.local -OrganizationalUnit yourAD.yourDomain.local/YourRootOu/yourDesiredOu -resultsize unlimited | Where-Object {$_.primarysmtpaddress.length -ne 0 -and $_.ServerName -like "yourExServersYouWantHere*"} #you get only mailboxes of that OU and Servers with valid smtp addresses
    
    $outputToFile = $true #set it to $true to redirect the output into a text-file
    $pathToFile = "C:\temp\mailboxCalendarPermissionsOfAllUsers.csv"
    $numberOfMailboxes = 0
    
    if ($outputToFile) {#write column-headers to file, as CSV-Standard and create new file
      [string]::Join(",",("mailbox.DisplayName", "mailbox.ServerName", "mailbox.PrimarySmtpAddress","calendar.FolderName", "calendar.User","calendar.AccessRights")) | Out-File -filepath $pathToFile
    }
    
    #Loop through all mailboxes 
    foreach ($mailbox in $mailboxes) { 
      $numberOfMailboxes += 1 #count number of mailboxes
      
    #Retrieve name of the user`s calendar, independently of his own language selected.
    #I guess First 1 takes the shared calendar and not any other ones the users can create and name as they want
    #strangely in mailboxes where I created a second calendar First 2 retreaves still the first/system calendar
    #I had to issue this cmdlet to get a calendar I named secondCalendar
    #Get-MailboxFolderStatistics -Identity yourUserName -folderScope all | where-object {$_.folderpath -like "/second*"}
    #strangely enumerating all folders shows this folder type to be "user created" and not "calendar" which explains why it is not
    #retrieved by -FolderScope Calendar
    
      $calendar = (($mailbox.userPrincipalName)+ ":\" + (Get-MailboxFolderStatistics -Identity $mailbox.userPrincipalName -FolderScope Calendar | Select-Object -First 1).Name) 
    
      $calendarUsers = Get-MailboxFolderPermission $calendar | select-object -property FolderName, User, AccessRights
      #$calendarUsers #for testing
      
      Write-Host "Retrieving calendar permission for $mailbox..." -ForegroundColor Yellow 
      
      if ($outputToFile) {#write first part of output
        Write-Host "...and writing to file" -ForegroundColor Yellow
        [string]::Join(",",($mailbox.DisplayName, $mailbox.ServerName, $mailbox.PrimarySmtpAddress)) | Out-File -append -NoClobber -filepath $pathToFile  
      } else {#write to console
        $mailbox | ft DisplayName, ServerName, PrimarySmtpAddress
      }
      
      #loop over every user in calendar
      foreach ($calendaruser in $calendarUsers) {
        
        if ($outputToFile) {
          [string]::Join(",",($calendaruser.FolderName, $calendaruser.User, $calendaruser.AccessRights)) | Out-File -append -NoClobber -filepath $pathToFile
        } else {#write to console
          $calendaruser | ft FolderName, User, AccessRights
        }
      }
    }
    
    Write-Host "Total number of mailboxes processed: $numberOfMailboxes" -ForegroundColor Yellow
    
    

    • Edited by Rosario2 Thursday, March 7, 2013 2:56 PM
    Thursday, March 7, 2013 2:51 PM
  • And now the one to SET permissions on any given user:

    #
    # script to set the permissions given in the corresponding variable, on their mailbox-calendar DEFAULT USER
    # NOTE: you must remove or comment out the -whatif option in the corresponding line to actually set the
    # desired permissions. Otherwise the script runs through in non-destructive mode without doing any harm
    
    #NB. you can use the following commandlets:
    
    # Add-MailboxFolderPermission
    # Get-MailboxFolderPermission
    # Remove-MailboxFolderPermission
    # Set-MailboxFolderPermission
    
    # and these are the Permissions
    
    # None
    # Owner
    # PublishingEditor
    # Editor
    # PublishingAuthor
    # Author
    # NoneditingAuthor
    # Reviewer
    # Contributor
    # Custom
    # FreeBusyTimeOnly
    # FreeBusyTimeAndSubjectAndLocation
    
    # we could also list all the permissions the users have set, see my other script
    # retrieveCalendarPermissionsOfAllUsers.ps1, as there are a lot of other users with individual permissions
    # e.g. ANONYMOUS and users chosen from the EX-Organisation
    #
    # the output can be redirected to a text-file in the given path or to the console
    # you may want to use the Export-CSV cmdlet if you prefer
    #
    #Custom variables
    
    $mailboxes = Get-Mailbox -domaincontroller yourAD.yourDomain.local -OrganizationalUnit yourAD.yourDomain.local/YourRootOu/yourDesiredOu -resultsize unlimited | Where-Object {$_.primarysmtpaddress.length -ne 0 -and $_.ServerName -like "yourExServersYouWantHere*"} #you get only mailboxes of that OU and Servers with valid smtp addresses
    
    $accessRights = "AvailabilityOnly" #can be used to set this access-right or any other from the list above
    
    $outputToFile = $true #set it to $true to redirect the output into a text-file
    $pathToFile = "C:\temp\setMailboxCalendarPermissionsToAvailabilityOnlyOnDefaultUser.csv"
    $numberOfMailboxes = 0
    
    if ($outputToFile) {#write column-headers to file, as CSV-Standard and create new file
      [string]::Join(",",("mailbox.DisplayName", "mailbox.ServerName", "mailbox.PrimarySmtpAddress", "calendar.User", "calendar.AccessRights")) | Out-File -filepath $pathToFile
    }
     
    #Loop through all mailboxes 
    foreach ($mailbox in $mailboxes) { 
      $numberOfMailboxes += 1 #count number of mailboxes
      
    #Retrieve name of the user`s calendar, independently of his own language selected.
    #I guess First 1 takes the shared calendar and not any other ones the users can create and name as they want
    #strangely in mailboxes where I created a second calendar First 2 retreaves still the first/system calendar
    #I had to issue this cmdlet to get a calendar I named secondCalendar
    #Get-MailboxFolderStatistics -Identity yourUserName -folderScope all | where-object {$_.folderpath -like "/second*"}
    #strangely enumerating all folders shows this folder type to be "user created" and not "calendar" which explains why it is not
    #retrieved by -FolderScope Calendar
    
      $calendar = (($mailbox.userPrincipalName)+ ":\" + (Get-MailboxFolderStatistics -Identity $mailbox.userPrincipalName -FolderScope Calendar | Select-Object -First 1).Name) 
     
      #get default user whose permissions we want to set  
      $calendarDefaultUserPermission = (Get-MailboxFolderPermission $calendar | Where-Object {$_.User -like "Default"}).AccessRights #you might filter on any possible users here, see my other script
      
      if ($calendarDefaultUserPermission -ne "None") { #here you can check for any desired permissions and filter users you want to modify
    
        $mailbox | Add-Member -membertype noteproperty -name AccessRights -value $calendarDefaultUserPermission #combine properties for later output
    
        Write-Host "Updating calendar permission for $mailbox..." -ForegroundColor Yellow 
        
        if ($outputToFile) {#write/log also to file
          Write-Host "...and writing to file" -ForegroundColor Yellow
          [string]::Join(",",($mailbox.DisplayName, $mailbox.ServerName, $mailbox.PrimarySmtpAddress, "Default", $mailbox.AccessRights)) | Out-File -append -NoClobber -filepath $pathToFile
        } else {#write to console
          $mailbox | ft DisplayName, ServerName, PrimarySmtpAddress, AccessRights
        }    
     
        #Set calendar-permission for user "Default" to value defined in variable $accessRights. You might want to set permissions on any other user or users here
        
        #PAY ATTENTION WHEN REMOVING -whatif the Permissions are really set/altered in the next line
        
        Set-MailboxFolderPermission -User "Default" -AccessRights $accessRights -Identity $calendar -whatif
        
        #other Examples on other user
        #Set-MailboxFolderPermission -User "Anonymous" -AccessRights $accessRights -Identity $calendar -whatif
        #Set-MailboxFolderPermission -User "anyCustomUserMightAlsoBeAwholeDistributionList" -AccessRights $accessRights -Identity $calendar -whatif
        
        
        if ($outputToFile) {#write/log also to file
          [string]::Join(",",("Changed Permissions to", $accessRights)) | Out-File -append -NoClobber -filepath $pathToFile
        }    
      }
    }
    
    Write-Host "Total number of mailboxes processed: $numberOfMailboxes" -ForegroundColor Yellow
    
    


    Rosario

    Thursday, March 7, 2013 3:13 PM
  • This answer proved to be an excellent starting point, however, I found that creating a new mailbox and then adding a permission didn't work, because it seems that a default permission is already added when the mailbox is created, at least in my experience. 

    If your permissions aren't changing or you're getting an error in the shell such as "An existing permission entry was found", simply change 'New-MailboxFolderPermission' to 'Set-MailboxFolderPermission'

    Worked like a charm for me, and only a slight modification on what was an excellent reference snippet!

    (this might also be a rather hard to diagnose issue if you're executing this cmdlet remotely in C# like I was doing, so I hope this helped)

    Mike 

    Monday, August 12, 2013 2:00 PM