Get FolderID

Glenn Maxwell 12,871 Reputation points
2022-01-07T19:12:55.963+00:00

Hi All

i want to get folder ids, i am using the below two syntaxes, for the first syntax i am getting folder id but it is not in the FromBase64String format, i am not sure how to fetch using the second syntax. experts guide me.

Get-MailboxFolderStatistics -Identity user1@Company portal .com | select Name, FolderId,FolderPath,FolderAndSubfolderSize
Get-MailboxFolderStatistics -Identity user1@Company portal .com -FolderScope RecoverableItems |Format-Table Name,FolderAndSubfolderSize,ItemsInFolderAndSubfolders -Auto

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,171 questions
Exchange Exchange Server Management
{count} votes

Accepted answer
  1. KyleXu-MSFT 26,396 Reputation points
    2022-01-10T01:49:44.707+00:00

    @Glenn Maxwell

    The "-FolderScope" attributes only supported with folder name:
    163414-qa-kyle-09-46-33.png

    It doesn't supported with folder id.

    If you want to get folder id for that mailbox, you need to use the script in the article that michev provided: Script.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Vasil Michev 119.5K Reputation points MVP Volunteer Moderator
    2022-01-08T06:48:57.35+00:00

    Care to explain what are you trying to achieve here? If you need the folder id for features like targeted collection, use the script here: https://learn.microsoft.com/en-us/microsoft-365/compliance/use-content-search-for-targeted-collections?view=o365-worldwide
    An alternative/simpler version of the script is available here: https://www.enowsoftware.com/solutions-engine/performing-ediscovery-against-a-specific-folder

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.