2

I want to get a list of folders of my mailbox in PowerShell.

Since we're having ExchangeOnline, I connect to my exchange server like this:

$Session = New-PSSession -ConfigurationName Microsoft.Exchange `
           -ConnectionUri https://ps.outlook.com/powershell/ -Credential $cred `
           -Authentication Basic -AllowRedirection
Import-PSSession $Session

Now to my problem, Get-MailboxFolderPermission works, but Get-MailboxFolder always returns The mailbox xy@xy.com is not available. why?

PS Z:\Powershell-Scripts\Functions\Exchangeonline> Get-MailboxFolderPermission "xy@xy.com:\Inbox"

FolderName           User                 AccessRights                                                                                                 SharingPermissionFlags                                                                                     
----------           ----                 ------------                                                                                                 ----------------------                                                                                     
Inbox                Standard             {None}                                                                                                                                                                                                                  
Inbox                Anonym               {None}                                                                                                                                                                                                                  



PS Z:\Powershell-Scripts\Functions\Exchangeonline> get-mailboxfolder "xy@xy.com:\Inbox"
Das angegebene Postfach "xy@xy.com" ist nicht vorhanden.
    + CategoryInfo          : NotSpecified: (:) [Get-MailboxFolder], ManagementObjectNotFoundException
    + FullyQualifiedErrorId : [Server=AM4PR0302MB2626,RequestId=a6939056-15df-4b45-a10b-8b1cbb4a9207,TimeStamp=15.03.2018 14:31:00] [FailureCategory=Cmdlet-ManagementObjectNotFoundException] 9DD76FE4,Microsoft.Exchange.Management.StoreTasks.GetMailboxFolder
    + PSComputerName        : ps.outlook.com

I'm on PSVersion 5.1.14393.2068

edit: it does also not work on 5.1.16299.251 and 4.0

SimonS
  • 767
  • 3
  • 13
  • 28

1 Answers1

0

Running Get-Help on the command gives us this:

"Use the Get-MailboxFolder cmdlet to view folders in your own mailbox. Administrators can't use this cmdlet to view folders in other mailboxes (the cmdlet is available only from the MyBaseOptions user role)."

Seems like it's doing exactly what it was built to do.

shinjijai
  • 416
  • 1
  • 7
  • 16