Solved

Exchange 2010 - determine what end user device is connected to exchange

Posted on 2016-10-13
3
36 Views
2 Endorsements
Last Modified: 2016-10-13
Hello,

I am have client that needs to determine if a user has connected a personal (non-company) controlled device to send and receive email.  Is there a way in Exchange 2010 to do this?  I need to not only know it is connected but determine when the last connection was.

On a related note, I need to track an email that was sent by the user to determine if it was sent from a personal or company issued device.  Is there a way to do that?
2
Comment
Question by:AdvNetSol
3 Comments
 
LVL 5

Assisted Solution

by:Addy Nadia
Addy Nadia earned 250 total points
ID: 41842522
Hello,

You can get this by below command in powershell

Get-activesyncdeviceStatistics –Mailbox “userid" | Format-List DeviceID, DeviceType,DeviceModel, DeviceOS, FriendlyName,FirstSyncTime, LastSuccessSync,Deviceaccessstate
0
 
LVL 7

Accepted Solution

by:
Senior IT System Engineer earned 250 total points
ID: 41842795
You can also use this script:

But first you need to modify the SMTP parameter to be able to receive the result on email:

Get-Mailbox -ResultSize Unlimited | ForEach {
     $User = $_.DisplayName
    Get-MobileDeviceStatistics -Mailbox:$_.Identity |
    Select-Object @{label="User" ; expression={$User}},DeviceOS,lastsuccesssync   
 }| Export-csv C:\temp\report.csv -nti


### BEGINNING OF SCRIPT

#####
#
# Get-ActiveSyncDeviceReport
# Author: Paul Ponzeka
# Website: port25guy.com
# email ponzekap2 at gmail dot com
#
######
param(
    [Parameter(Mandatory = $true)]
    [string] $SMTPServer = "",
    [Parameter(Mandatory = $true)]
    [string] $SMTPFrom = "",
    [Parameter(Mandatory = $true)]
    [string] $SMTPTo = "",
    [Parameter(Mandatory = $true)]
    [string] $exportpath = ""
    )

#######
#
# HTML Formatting Section
# Thanks to Paul Cunningham at http://exchangeserverpro.com/
#
#######
#
# 
#
######
$style = "<style>BODY{font-family: Arial; font-size: 10pt;}"
$style = $style + "TABLE{border: 1px solid black; border-collapse: collapse;}"
$style = $style + "TH{border: 1px solid black; background: #dddddd; padding: 5px; }"
$style = $style + "TD{border: 1px solid black; padding: 5px; }"
$style = $style + "</style>"


$messageSubject = "ActiveSync Device Report"

$message = New-Object System.Net.Mail.MailMessage $smtpfrom, $smtpto
$message.Subject = $messageSubject
$message.IsBodyHTML = $true

####  Get Mailbox

$EASDevices = ""
$AllEASDevices = @()

$EASDevices = ""| select 'User','PrimarySMTPAddress','DeviceType','DeviceModel','DeviceOS', 'LastSyncAttemptTime','LastSuccessSync'
$EasMailboxes = Get-Mailbox -ResultSize unlimited
foreach ($EASUser in $EasMailboxes) {
$EASDevices.user = $EASUser.displayname
$EASDevices.PrimarySMTPAddress = $EASUser.PrimarySMTPAddress.tostring()
    foreach ($EASUserDevices in Get-ActiveSyncDevice -Mailbox $EasUser.alias) {
	$EASDeviceStatistics = $EASUserDevices | Get-ActiveSyncDeviceStatistics
    $EASDevices.devicetype = $EASUserDevices.devicetype
    $EASDevices.devicemodel = $EASUserDevices.devicemodel
    $EASDevices.deviceos = $EASUserDevices.deviceos
	$EASDevices.lastsyncattempttime = $EASDeviceStatistics.lastsyncattempttime
	$EASDevices.lastsuccesssync = $EASDeviceStatistics.lastsuccesssync
    $AllEASDevices += $EASDevices | select user,primarysmtpaddress,devicetype,devicemodel,deviceos,lastsyncattempttime,lastsuccesssync
    }
    }
$AllEASDevices = $AllEASDevices | sort user
$AllEASDevices
$AllEASDevices | Export-Csv $exportpath\ActiveSyncReport.csv

######
#
# Send Email Report
#
########

$message.Body = $AllEasDevices | ConvertTo-Html -Head $style

$smtp = New-Object Net.Mail.SmtpClient($smtpServer)
$smtp.Send($message)

##END OF SCRIPT

Open in new window


or this one to get the last 30 days device:

get-mailbox -ResultSize unlimited -Filter {EmailAddresses -like "*@yourdomain.com" } | 
ForEach {Get-ActiveSyncDeviceStatistics -Mailbox:$_.Identity -ErrorAction SilentlyContinue} | 
where {$_.lastsuccesssync -gt '01/10/2016'} | 
Sort-Object -Property DeviceType,Identity | 
Select-Object @{name="EmailAddress";expression={$_.Identity.ToString().Split("\")[0]}},DeviceType | 
Export-Csv -Path:"c:\MobileDevices_email.com.csv"

Open in new window

0
 

Author Comment

by:AdvNetSol
ID: 41842972
thank you both.  i appreciate your help.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
how to add IIS SMTP to handle application/Scanner relays into office 365.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now