Today I had to prepare some things for migration between two Active Directory forests. Both sites have a 2-Way trust between and this trust will be killed after the migration. The 2nd (new) forest has everything what is needed. An Exchange environment, Skype for Business, Sharepoint, etc.
A working college, who is responsible for this project, for the mobile device management has asked me to give him some information about users and their mobile devices.
He asked me if I can create a report for him with the following information:
- Displayname
- Alias
- Primary SMTP
- Company
- Department
- Some Custom Attributes
- Last synchronization of the mobile devices
- OU
- Sync Age of the Devices
- GUID
- Mobile device type
- Device OS
- And some other information
Solution:
However, the fastest way to create this kind of report is using PowerShell. The only challenge we have to fix for the success is, that we have to collect some information from different cmdlets like: Get-Mailbox, Get-CASMailbox and Get-ActiveSyncDeviceStatistics. As well, we need the command Get-ADUser command that is not an Exchange command.
Although I am not the only one who needs this information time by time, I have written a script, which does all the work for us.
To run the script we need an Exchange Management Shell and (if not already installed) the RSAT-ADDS PowerShell Module.
Note: If you need to install the RSAT-ADDS tools on your local Computer, I can highly recommend you the Script from Ashley McGlone from the Microsoft Technet.
2nd Note: I have written this script to be running on an Exchange 2013 or 2016 environment. I did not test it on an Exchange 2010 environment.
By the way: If you want to know how to install the Exchange Management Tools on your local computer, simply follow my other article HERE. In this article I describe, how to install the Exchange Management Shell on our local computer.
The script can be downloaded for free on the Microsoft Technet, to get it, simply klick HERE.
How to use the Script
So, but now let us come back now to the current script:
After downloading it from the Microsoft Technet <LINK>, Save it on the path you want to run it and open your Exchange Management Shell and start the Script. No further parameter are needed.
As you can see, the Script starts fast and shows you in a progress bar how many EAS device information are already collected:
When the Script is done, it will leave you the Note with this information:
The script is written in that way, that the created CSV file will be saved on the same place, from where we have started our script:
After opening the CSV file, and formatting it, we get the output with all information we need:
Conclusion:
Easy Script, not a huge project about, but it helps to get all information we need around the Mobile Devices in our Environment. I simply hope, it will help you to make your daily work bit easier.
By the way, If you want to remove old EAS devices from your Organization, I can highly recommend you the article on my Blog HERE.
However, if you think there is more needed in this script, you are always welcome to leave some comment here…
🙂
Photo by Nine Köpfer on Unsplash