locked
Issues with Get-MailboxFolderPermission cmdlet and foreign characters in the name of the folder RRS feed

  • Question

  • Hello everyone,

    I am responsible of exchange environment in an international organization, and I have a need to search for mailboxes' calendars that are without any permissions for "Default".

    So I went and got all mailboxes to a variable, and ran for each mailbox:

    (Get-MailboxFolderPermission "$($_.Alias):\Calendar" -User Default).AccessRights

    And for Japanese mailboxes (for example) I received an error that the folder doesn't exists.

    So I ran before a Get-MailboxFolderStatistics, in order to get the name of the folder with the folder type "Calendar".

    $FolderName = (Get-MailboxFolderStatistics $_.Alias | where FolderType -like Calendar).Name
    Get-MailboxFolderPermission  $($_.Alias):\$($FolderName) -User Default

    But for my surprise that didn't work as well.

    The error is the same error, the command can't find the folder. I believe this time it might be caused due to unsupported characters, such as the Japanese characters. Is there any way of dealing this?

    I've opened a thread in "Exchange Server 2013 - Administration, Monitoring, and Performance" and they suggested I'll ask in this forum.

    ---------------------------------------------------------------

    Update -

    I found the issue and it was a misspelled calendar name of the mailbox, not an issue with the query.

    You can read below comment

    ---------------------------------------------------------------


    • Edited by Yuval.S Wednesday, September 21, 2016 7:39 AM Update
    Sunday, September 18, 2016 10:32 AM

Answers

  • As it seems - I was wrong that the query I tried wasn't good to solve the conflict with the calendars in different languages.

    It turns out that after writing the query and looking for a mailbox to test it- I've picked a mailbox with a miss spelled name of calendar when querying it's folders statistics.

    The folder name appeared as ???1 and when I exported to Unicode it was three Japanese letters and then 1.

    So after some unsuccessful tries working with that name, I've realised that maybe the folder name shouldn't be with 1 at the end, so when I removed the 1 (and was left with those three question marks that are translated to Japanese), it worked.
    I looked at a different Japanese mailbox and when I queried the folder statistics I received a result with the calendars name without the 1 in the end, so it probably means that the mailbox with the calendar name with 1 is a misspelled.

    Thanks you for providing assistance. Sorry for the troubling.

    • Marked as answer by Yuval.S Wednesday, September 21, 2016 7:39 AM
    Wednesday, September 21, 2016 7:37 AM

All replies

  • You are passing an object, not a string value. Try this:

    Get-MailboxFolderPermission  $($_.Alias):\$($FolderName.Name) -User Default

    Sunday, September 18, 2016 6:10 PM
  • You are passing an object, not a string value. Try this:

    Get-MailboxFolderPermission  $($_.Alias):\$($FolderName.Name) -User Default

    I've already extracted the string of the folder name directly to the variable ($FolderName) when I declared it.

    You can see that I raped the query with brackets and took the name from it befor I put it into the variable... I wrote $FolderName = (my query).Name

    if it helps, the error I receive is:

    The operation couldn't be performed because '[The Alias of the mailbox]:\???1' couldn't be found.
        + CategoryInfo          : NotSpecified: (:) [Get-MailboxFolderPermission], ManagementObjectNotFoundException
        + FullyQualifiedErrorId : [Server=[Server Name],RequestId=[Request Id],TimeStamp=19/09/2016 11:48:44] [FailureCategory=Cmdl
       et-ManagementObjectNotFoundException] 2FFE8B34,Microsoft.Exchange.Management.StoreTasks.GetMailboxFolderPermission
        + PSComputerName        : [Server Name]

    What appears after the :\ (the string "???1") is what I got into the variable, if I export the variable to a file and save it using Unicode, I can see  the actual characters.


    • Edited by Yuval.S Monday, September 19, 2016 12:48 PM forgot to write part of a sentence
    Monday, September 19, 2016 12:45 PM
  • As it seems - I was wrong that the query I tried wasn't good to solve the conflict with the calendars in different languages.

    It turns out that after writing the query and looking for a mailbox to test it- I've picked a mailbox with a miss spelled name of calendar when querying it's folders statistics.

    The folder name appeared as ???1 and when I exported to Unicode it was three Japanese letters and then 1.

    So after some unsuccessful tries working with that name, I've realised that maybe the folder name shouldn't be with 1 at the end, so when I removed the 1 (and was left with those three question marks that are translated to Japanese), it worked.
    I looked at a different Japanese mailbox and when I queried the folder statistics I received a result with the calendars name without the 1 in the end, so it probably means that the mailbox with the calendar name with 1 is a misspelled.

    Thanks you for providing assistance. Sorry for the troubling.

    • Marked as answer by Yuval.S Wednesday, September 21, 2016 7:39 AM
    Wednesday, September 21, 2016 7:37 AM