Saturday, September 14, 2013

Exchange ActiveSync - Report

Hi All,

This script I have used to extract activesync details from exchange 2007 server.

below are the details:-

Userid

DeviceType

DeviceID

DeviceUserAgent

FirstSyncTime

LastSuccessSync

Identity

DeviceModel

DeviceFriendlyName

DeviceOS

Extract the zip file & run the batch file.

http://gallery.technet.microsoft.com/scriptcenter/Exchange-ActiveSync-Report-92279541



here is the report:




PowerShell

############################################################################# 
#       Author: Vikas Sukhija 
#       Date: 07/31/2013 
#       Description: Extract the Active Sync stats 
############################################################################# 

# Add Exchange Shell... 

If ((Get-PSSnapin | where {$_.Name -match "Exchange.Management"}) -eq $null) 

    Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin 


#format Date 

$date = get-date -format d 
$date = $date.ToString().Replace(“/”, “-”) 

$output = ".\" + "ActivesyncReport_" + $date + "_.csv" 

#create a collection to hold results(dynamic array) 

$Collection = @() 
Get-CASMailbox -resultsize unlimited | where{$_.ActiveSyncEnabled -eq "True"} | foreach-object{ 
$user = get-user $_.name 
$devices = Get-ActiveSyncDeviceStatistics -Mailbox $_.Identity | select DeviceType,DeviceID,DeviceUserAgent,FirstSyncTime,LastSuccessSync, 
Identity,DeviceModel,DeviceFriendlyName,DeviceOS 
$devices | foreach-object { 

$coll = “” | select Userid,DeviceType,DeviceID,DeviceUserAgent,FirstSyncTime,LastSuccessSync, 
Identity,DeviceModel,DeviceFriendlyName,DeviceOS 

$coll.Userid = $user.name 
$coll.DeviceType = $_.DeviceType 
$coll.DeviceID = $_.DeviceID 
$coll.DeviceUserAgent = $_.DeviceUserAgent 
$coll.FirstSyncTime = $_.FirstSyncTime 
$coll.LastSuccessSync = $_.LastSuccessSync 
$coll.Identity = $_.Identity 
$coll.DeviceModel = $_.DeviceModel 
$coll.DeviceFriendlyName = $_.DeviceFriendlyName 
$coll.DeviceOS = $_.DeviceOS 

$Collection += $coll 





#export the collection to csv , change the path accordingly 

$Collection | export-csv $output 

#######################################################################################



 

 

Regards

Sukhija Vikas

1 comment:

  1. Hello Vikas,

    This is the only script that I found that actually gave me exactly what I needed out of Exchange 2007, the only one !

    Thank you so much,
    from Vancouver, Canada !

    ReplyDelete