Upload files to "/"

This commit is contained in:
2026-02-04 13:46:41 +00:00
parent 288ff1655b
commit 5d6d56e96c

31
ActiveSync_Last30Days.ps1 Normal file
View 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