Exchange Activesync Powershell

I just found this script online that will tell me almost everything i need to know about my exchange 2010 activesync connections. the only thing i am missing the lastsuccesssync parameter.
I have pasted the bit of the script that seems to deal with the device parameters and was hoping someone could tell me what i need to add to make it give lastsuccesssync as well.

####  Get Mailbox

$EASDevices = “”
$AllEASDevices = @()

$EASDevices = ”| select ‘User’,'DeviceType’,'DeviceModel’,'DeviceOS’
$EasMailboxes = Get-Mailbox
foreach ($EASUser in $EasMailboxes) {
$EASDevices.user = $EASUser.displayname
    foreach ($EASUserDevices in Get-ActiveSyncDevice -Mailbox $EasUser.alias) {
    $EASDevices.devicetype = $EASUserDevices.devicetype
    $EASDevices.devicemodel = $EASUserDevices.devicemodel
    $EASDevices.deviceos = $EASUserDevices.deviceos
    $AllEASDevices += $EASDevices | select user,devicetype,devicemodel,deviceos
$AllEASDevices = $AllEASDevices | sort user
$AllEASDevices | Export-Csv $exportpath\ActiveSyncReport.csv


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David CarrCommented:
LastSuccessSync is a property of Get-ActiveSyncDevicesStatistics and is only available in Exchange Server 2010

Try the following code
Get-ActiveSyncDeviceStatistics $_.Identity -ErrorAction SilentlyContinue | Select DeviceType,DeviceID,DeviceModel,DeviceFriendlyName,LastSuccessSync,@{Name='User';Expression={$UserName}}

See more at
kingcastleAuthor Commented:
Yeah we are on exchange 2010 alright.
tried your command and nothing happens EMS just moves onto next line.
David CarrCommented:
Correction. Get-ActiveSyncDeviceStatistics is not a 2010 only cmdlet. Sorry about that.

Pick a user and run the following:

Get-ActiveSyncDeviceStatistics -mailbox alias | select DeviceType, LastSuccessSync

You should see outuput like the following:

DeviceType                                    LastSuccessSync
----------                                            ---------------
BlackBerry                                     1/31/2013 1:23:31 PM
TestActiveSyncConnectivity         1/24/2013 1:28:02 PM

the link I posted above has the complete script that  you can reference. Sorry I was not clear.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

kingcastleAuthor Commented:
grand i can get that bit but how would i incorporate the LastSuccessSync into the original script i pasted above?
David CarrCommented:
Is that the entire script or a snippet?
kingcastleAuthor Commented:
snippet you can see entire script at the site i found would you like me to post the link?

its by adn its called

How to Get a Report of Active Sync Devices in Exchange 2010/Exchange 2013
kingcastleAuthor Commented:
no update

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kingcastleAuthor Commented:
No further comment
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.