Partager via


Determine ActiveSync Users with the most hits

Here is a PowerShell script that will determine what ActiveSync user has the most hits against a certain CAS for the day that it runs. The script has the following configurable settings.

# Active Sync Log Directory
$ActiveSyncLogDirectory = "C:\Inetpub\Logs\LogFiles\W3SVC1"

# Active Sync Output folder, This is a temp location and will be delete after the script runs
$ActiveSyncOutputFolder = "C:\EASReports"

# Hit Threshold value where the report will notify the admin
[int]$maxhits = 1000

# Enable Email report, $true of $false
$SendEmailReport = $true

# Recipient
$recipient = "user@domain.com"

# Sender
$sender = "sender@domain.com"

# SMTP Server address
$SMTPServer = "192.168.1.1"

As you can see this script has the option to email the report but if this is set to $False then the EASyncOutputReport.html report will be placed in the folder $ActiveSyncOutputFolder path. Also this script will require you to run
Set-ExecutionPolicy RemoteSigned Script Requirements:

* Exchange 2010
* IIS Logs to use W3C
* IIS Logs schedule to be Daily

image

 

Example of the HTML output

Overview Report 09/12/2011 14:27:32

User DeviceID Hits DeviceType
submissionq\testuser01 BAD73E6E02156460E800185977C03182 298 PocketPC
submissionq\testuser02 BAD73E6E02156460E800185977C03183 9872 PocketPC
submissionq\testuser03 BAD73E6E02156460E800185977C03184 138 PocketPC
submissionq\testuser04 BAD73E6E02156460E800185977C03181 433 PocketPC

Detailed Report 09/12/2011 14:27:32

User DeviceID Hits DeviceType DeviceInfo
submissionq\testuser01 BAD73E6E02156460E800185977C03182 298 PocketPC  
submissionq\testuser02 BAD73E6E02156460E800185977C03183 9872 PocketPC  
submissionq\testuser03 BAD73E6E02156460E800185977C03184 138 PocketPC  
submissionq\testuser04 BAD73E6E02156460E800185977C03181 433 PocketPC  

*** There will be a version 2! I have noticed that on large IIS logs it takes some time. I have found a far better/faster way gather this data

ActiveSyncHitsReport.ps1