Ortografia localizada da subpasta do calendário do Exchange
Portanto, o problema parece estar relacionado ao username:calendar
embutido em seu script, pois o nome localizado do calendário na caixa de correio do usuário tem uma ortografia diferente da que você está usando.
Então, em vez da grafia de username:calendar
, a ortografia pode ser username:kalendar
ou username:agenda
, dependendo da localização do idioma.
Abaixo estão alguns métodos com referência a obter a ortografia da subpasta da agenda sem realmente saber a ortografia localizada do objeto; você pode conectar o resultado ao (s) seu (s) comando (s), ou potencialmente construir o (s) comando (s) para obtê-lo dinamicamente com base no DistinguishedFolderId , etc.
Get-MailboxCalendarFolder
Get-MailboxCalendarFolder -Identity <MailboxFolderIdParameter> [-DomainController <Fqdn>]
Detailed Description
The Get-MailboxCalendarFolder cmdlet retrieves information for the specified calendar folder. This information includes the calendar folder name, whether the folder is currently published or shared, the start and end range of calendar days published, the level of details published for the calendar, whether the published URL of the calendar can be searched on the Web, and the published URL for the calendar.
source
Powershell get default calendar name
A way to get the name of the default calendar folder without checking the regional or language properties.
Get-mailbox | Get-MailboxFolderStatistics -FolderScope calendar | sort-object Name | ft Identity,Name
If the User has several Calendars in Mailbox I've got multiple objects. You must iterate through all of them, or filter them with 'where-object' to get just the default calendar.
$calname = Get-MailboxFolderStatistics -Identity $username -FolderScope calendar | where-object {$_.FolderType -eq "Calendar"} $calandar= $username + ":\" + $calname.Name.toString()
Finding the name of the Calendar folder
When setting permissions on your users' Calendar folders to allow (or disallow) them to view each others Free/Busy status, you may encounter the problem that a user has localized the folder names and you don’t know what the name of the folder is in his/her language. Even worse; you’re doing this in a script, that’s just using the
username:\Calendar
label.The solution here is to not use hard coded names but instead detect the name of the folder and use it in your script (or command line). To make that really simple, you can use this bit of PowerShell code:
$path = $user.Identity + ":\" + (Get-MailboxFolderStatistics $user.Identity | Where-Object { $_.Foldertype -eq "Calendar" } | Select-Object -First 1).Name Set-MailboxFolderPermission -Identity $path -User Default -AccessRights LimitedDetails
The first line will search the MailboxFolderStatistics for folders of the type “Calendar” and return the first match.
Second line will use the variable
$path
to setAccessRights
on the folder regardless of localization.The
$user
variable could have been populated with Get-User or an input file.source