2

Ok, it's this stuff, right here... o( ><)o

 $PubFolder = "SomeMailEnabledFolder"
 Get-MailPublicFolder $PubFolder | Get-PublicFolder

This should be so. dang. simple...

The error returned:

Cannot process argument transformation on parameter 'Identity'. Cannot convert value "MyDomain/Microsoft Exchange System Objects/Mailbox Name" to type "Microsoft.Exchange.Configuration.Tasks.PublicFolderIdParameter". Error: "The value provided for parameter "MyDomain/Microsoft Exchange System Objects/Mailbox Name" isn't in the correct format. The correct format is "<FolderPath>"."

I have tried a bunch of stuff, like catenating a slash into it, passing the $var.name parameter, hurling my best Shakespearian insults at my monitor, etc... Nothing works.

I am ready to punch a dolphin at this point... I have a feeling the answer is simple, which will annoy me even further, but cest' la vie.

I beseech you... Save a dolphin (actually, I might not win a fight with a dolphin come to think of it, nevertheless), and lend a hand...

You have my gratitude in advance.

May the Force be with you.

Techknow
  • 161
  • 1
  • 3
  • 11
  • 1
    The resulting object of `Get-MailPublicFolder` inherits from [MailEnabledRecipient](https://learn.microsoft.com/en-us/previous-versions/exchange-server/exchange-150/ff324125(v=exchg.150)) which has an `Identity` member. I can't see the source for `Get-PublicFolder`, but possibly it doesn't take the Identity parameter as a `ValueFromPipelineByPropertyName`. Does it work if you pass the `Identity` parameter - `Get-MailPublicFolder $PubFolder | % { Get-PublicFolder -Identity $_.Identity }` OR `(Get-MailPublicFolder $PubFolder).Identity | Get-PublicFolder`. – Ash Sep 30 '21 at 21:12
  • Testing... Stay tuned. – Techknow Oct 01 '21 at 16:53
  • The first bit returned the same error. The second bit returned: The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input. – Techknow Oct 01 '21 at 17:39
  • Just a bit of background. This is a hybrid environment, but the PFs are on-prem. I am connected on-prem... Also, interestingly, the Identity and path fields returned by _get-mailpublicfolder_ did not match the actual path to the folder (I found it by other means). The identity attrib returned was _domain/Microsoft Exchange System Objects/mailbox_ which was not indicative of the actual location. – Techknow Oct 01 '21 at 18:15
  • If `Get-MailPublicFolder` does not return any property in any of it's fields that can be passed via the pipeline to `Get-PublicFolder` then you're going to have to rethink your approach. [`Get-PublicFolder`](https://learn.microsoft.com/en-us/powershell/module/exchange/get-publicfolder?view=exchange-ps#syntax) requires a [`PublicFolderIdParameter`](https://learn.microsoft.com/en-us/previous-versions/office/exchange-server-api/ff344286(v=exchg.150)) type object. Sorry I can't help any further, I don't really do any Exchange admin. – Ash Oct 01 '21 at 18:44
  • 1
    Why not simply do `Get-PublicFolder -Mailbox $PubFolder` ? If you want all mail enabled Public folders you can do `Get-PublicFolder -Recurse -ResultSize Unlimited | Where-Object { $_.MailEnabled -eq $true }` – Theo Oct 01 '21 at 19:15

1 Answers1

1

Thank you Theo , posting your suggestion as an answer to help other community members.

"You can try simply Get-PublicFolder -Mailbox $PubFolder , And If you want all mail enabled Public folders you can do Get-PublicFolder -Recurse -ResultSize Unlimited | Where-Object { $_.MailEnabled -eq $true }"

For more information please refer this MS DOC: Cannot process argument transformation error for cmdlets

AjayKumarGhose
  • 4,257
  • 2
  • 4
  • 15
  • Yeah, one would think... When I do that, it returns, cannot find recipient... I am attempting to find the parent path of the folder based on the email address... – Techknow Oct 04 '21 at 18:30