Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Get value from higher pipe level

$
0
0

I'm getting mobile device stats from Exchange against each box, but get-mobiledevicestatistics unfortunately doesn't return a friendly name of the box it's retrieving — the closest thing is the Identity field, which spits out the full CN with the username crammed in the middle. Here's what I'm using:

$UserList = Get-CASMailbox -Filter {hasactivesyncdevicepartnership -eq $true -and -not displayname -like "CAS_{*"} | Get-Mailbox
 
$UserList | foreach { Get-MobileDeviceStatistics -Mailbox $_.alias} | FL $userlist.Name, DeviceModel, LastSuccessSync

Is there a way to retrieve the name field from the initial command? The "$userlist.Name" throws this:
FL : Cannot convert System.Object[] to one of the following types {System.String,
System.Management.Automation.ScriptBlock}.


Viewing all articles
Browse latest Browse all 13067

Trending Articles