Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

ActiveSync Report

$
0
0

Hi All,

 

I am using below script to generate activesyn report. I am importing 53K Activesync users which is running from last 4 days. Some have any idea to run this multi thread to get the report faster?

 

if ( (Get-PSSnapin -Name Microsoft.Exchange.Management.PowerShell.E2010 -ErrorAction SilentlyContinue) -eq $null )

{

    Add-PsSnapin Microsoft.Exchange.Management.PowerShell.E2010

}

$ErrorActionPreference = "silentlycontinue"

$EASDevices = “”

$AllEASDevices = @()

 

$EASDevices = “”| select ‘User’,’PrimarySMTPAddress’,’DeviceType’,’DeviceModel’,’DeviceOS’, ‘LastSyncAttemptTime’,’LastSuccessSync’

$EasMailboxes = Import-Csv C:\ActiveSync\batches\ActiveSync_users_Jun.csv | foreach {Get-Mailbox -Identity $_.identity}

#$EasMailboxes

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 | Export-Csv -Path C:\ActiveSync\batches\ActiveSyncReport.csv -NoTypeInformation

    }

    }


Viewing all articles
Browse latest Browse all 6937

Trending Articles