Upload files to "/"
This commit is contained in:
31
ActiveSync_Last30Days.ps1
Normal file
31
ActiveSync_Last30Days.ps1
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
Connect-ExchangeOnline
|
||||||
|
|
||||||
|
$since = (Get-Date).AddDays(-30)
|
||||||
|
|
||||||
|
$devices = Get-MobileDevice -ResultSize Unlimited |
|
||||||
|
Where-Object {
|
||||||
|
($_.ClientType -eq 'EAS' -or $_.ClientType -match 'ActiveSync') -and
|
||||||
|
$_.ClientVersion -and
|
||||||
|
([version]$_.ClientVersion -lt [version]'16.1')
|
||||||
|
}
|
||||||
|
|
||||||
|
$report = foreach ($d in $devices) {
|
||||||
|
$s = Get-MobileDeviceStatistics -Identity $d.Identity -ErrorAction SilentlyContinue
|
||||||
|
if ($s -and $s.LastSuccessSync -and $s.LastSuccessSync -ge $since) {
|
||||||
|
[pscustomobject]@{
|
||||||
|
UserDisplayName = $d.UserDisplayName
|
||||||
|
Mailbox = $d.UserPrincipalName
|
||||||
|
DeviceId = $d.DeviceId
|
||||||
|
DeviceModel = $s.DeviceModel
|
||||||
|
DeviceOS = $s.DeviceOS
|
||||||
|
ClientType = $d.ClientType
|
||||||
|
ClientVersion = $d.ClientVersion
|
||||||
|
LastSuccessSync = $s.LastSuccessSync
|
||||||
|
FirstSyncTime = $s.FirstSyncTime
|
||||||
|
Status = $s.Status
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$report | Sort-Object UserDisplayName | Format-Table -AutoSize
|
||||||
|
$report | Export-Csv .\ActiveSync_Last30Days.csv -NoTypeInformation -Encoding UTF8
|
||||||
Reference in New Issue
Block a user