Multiple piplelines

I’ve read through multiple docs on powershell piplelines, but I’m stuck in a place where I need to use two pipelines with two variables for Exchange Online.

For example:

[pre]get-mailbox -ResultSize unlimited[/pre]

Will give me a bunch of mailboxes. One of the values returned is recipientTypeDetails, so:

[pre] get-mailbox -ResultSize unlimited |where {$_.recipientTypeDetails -eq “roomMailbox”} |ft name,alias [/pre]

Will give me a list of all roomMailboxes with the Name and Alias fields.

I need to pipe that in to a 3rd command in order to see the value of “automateprocessing” of all rooms.

[pre]Get-CalendarProcessing -identity MyRoomName | ft identity,automateprocessing [/pre] does that for me for a single room. I want to get the output of all rooms from the 2nd command in order to build that list.

[pre]get-mailbox -ResultSize unlimited |where {$.recipientTypeDetails -eq “roomMailbox”} | Get-CalendarProcessing -Identity {$.Identity}[/pre]

fails miserably. What am I doing wrong? Or does this need to be a foreach loop?

you’re passing a scriptblock in for the identity flag.

so, this will work as would any of the other attributes that get-calenderprocessing accepts for identity:
get-mailbox -ResultSize unlimited |where {$.recipientTypeDetails -eq “roomMailbox”} | Get-CalendarProcessing $.alias

as well, since identity on get-calendarprocessing accepts pipeline input, all you truly need is the following:

get-mailbox -ResultSize unlimited |where {$_.recipientTypeDetails -eq “roomMailbox”} | Get-CalendarProcessing

The Get-CalendarProcessing cmdlet doesn’t accept pipeline input in that way. You need to strip your objects down to just the Identity property, as the receiving command’s parameter only accepts input by value. In order to accept the scriptblock syntax, I believe it needs to accept pipeline input by property name (refer to the docs page or Get-Help to determine what kinds of input each parameter can accept.)

You’re not far off, though!

Get-Mailbox -ResultSize unlimited |
    Where-Object RecipientTypeDetails -eq "roomMailbox" |
    Select-Object -ExpandProperty Identity |

These worked. Thanks!