-
Notifications
You must be signed in to change notification settings - Fork 2
/
get-EXCH_ActiveSyncDevices.ps1
48 lines (35 loc) · 1.27 KB
/
get-EXCH_ActiveSyncDevices.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<#
.SYNOPSIS
Gets a list of Exchange ActiveSync devicdes
.NOTES
Script Name: get-EXCH_ActiveSyncDevices.ps1
Created By: Gavin Townsend
Date: August 2019
.DESCRIPTION
The script performs the follow actions:
- Collects mobile devices and statistics
.EXAMPLE
.\get-EXCH_ActiveSyncDevices.ps1
.REQUIREMENTS
Exchange Management Tools PowerShell plugin
.AUDIT CRITERIA
Complete a discovery scan of ActiveSync devices in Exchange
Make a note of total numbers for comparison with MDM test case
.VERSION HISTORY
1.0 Aug 2019 Gavin Townsend Original Build
#>
Try{$Domain = $(get-addomain).dnsroot}
Catch{$Domain = ""}
$Log = "C:\temp\Audit\$Domain ActiveSync Devices $(get-date -f yyyy-MM-dd).csv"
$AllDevices = Get-MobileDevice -result unlimited | Get-MobileDeviceStatistics
$AllDeviceCount = $AllDevices.count
$AllDevices | Export-Csv $Log -notype -Encoding UTF8
write-Host ""
write-Host "---------------------------------------------------"
write-Host "Script Output Summary - ActiveSync Devices $(Get-Date)"
write-Host ""
write-Host "Mobile device count is $AllDeviceCount"
write-Host ""
write-Host "---------------------------------------------------"
write-Host ""
Write-Host "ActiveSync scanning tests concluded. Please review $Log"