Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

List ActiveSync users and their partnerships

$
0
0
 have done some searching and I try to use this script but keep getting this error message: Expressions are only allowed as the first element of a pipeline.
At line:1 char:107
+ get-casmailbox -filter * | {HasActivesyncDevicePartnership -eq $true -and -not DisplayName -like "CAS_{*"} <<<< ;| foreach {$name = $_.name; $device = get-activesync devicestatistics -m
ailbox $_.identity; $device | foreach {write-host $mbx.name, $_.devicemodel, $_.devicephonenumber, $_.deviceid, $_.FirstSyncTime, $_.LastSuccessSync} }
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : ExpressionsMustBeFirstInPipeline

This is the script I am using: get-casmailbox -filter * | {HasActivesyncDevicePartnership -eq $true -and -not DisplayName -like "CAS_{*"};| foreach {$name = $_.name; $device = get-activesync devicestatistics -mailbox $_.identity; $device | foreach {write-host $mbx.name, $_.devicemodel, $_.devicephonenumber, $_.deviceid, $_.FirstSyncTime, $_.LastSuccessSync} }

Thanks for helping.

Lynn

Viewing all articles
Browse latest Browse all 2562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>