Get all Mobile Devices on Office 365

In the past I have described how we can delete old EAS devices from our Exchange on-premises and/or Exchange online environment. More about that you can find HERE.

However, sometimes we just have to know how many and which devices are using ActiveSync on our Office 365 tenant.

In this article I will show you two simple ways, how we can do it!
In both cases we will use PowerShell to do it and in both cases we need (like always if we work with PowerShell on our tenant) to connect to our cloud. This we can do with following command:

After that we can get a simple overview about the mobile devices by using the following command:

As you can see in the picture below, we got some first information about our Mobile devices using ActiveSync.

So far so good, now we got a first view about the device we have in our environment. Unfortunately, this will be not enough for further tasks, this because we do not have enough information about Devices. We have no clue to whom it belongs and other additional information.

To get information like device ID, device type, etc. we need to create a PowerShell script. Don’t worry, in this case there is no rocket scenes needed… One way how script could look like you can see in the example below:

The result we get on the screen will look like this:

As you can see in the script, we will get as well as CSV-File, which will contain the same information, we got presented on the command line.

Note: In this script I am still using the old command Get-ActiveSyncDeviceStatistics. We also can use new cmdlet Get-MobileDeviceStatistics instead.

The script will look like this:

As I have promised you, this script has nothing to do with rocket Science. We simply had to collect all information, build a loop to get only the outputs we want to have and in the end we paste it to a csv file. Use the small script and/or change it in any ways you need. At the end of the day it should be a little help for you.

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *