{"id":413,"date":"2017-09-12T20:52:39","date_gmt":"2017-09-12T18:52:39","guid":{"rendered":"https:\/\/msb365.abstergo.ch\/?p=413"},"modified":"2019-05-28T13:37:12","modified_gmt":"2019-05-28T11:37:12","slug":"remove-old-eas-devices","status":"publish","type":"post","link":"https:\/\/www.msb365.blog\/?p=413","title":{"rendered":"Remove old EAS Devices"},"content":{"rendered":"<p>Earlier this month I had to make some cleanups\u00a0in a customer\u2019s Exchange infrastructure.<\/p>\n<p>On one side, I had to identify empty Distribution Groups and on the other side I had to clean up unused Mobile Devices (Active Sync) partnerships.<\/p>\n<p>The Exchange Organization contains more than 5\u2019000 warm Body (User) Mailboxes from which almost everyone has a Mobile Device.<\/p>\n<p>About the Distribution Group clean up I will write in\u00a0<strong><a href=\"https:\/\/msb365.abstergo.ch\/?p=408\" target=\"_blank\" rel=\"noopener noreferrer\">another Blog entry.<\/a><\/strong> Here we will talk about the Active Sync Devices!<\/p>\n<p>If you are an Exchange Engineer you know that a users mostly has more than one active sync device. Mostly an\u00a0user has one or two phones and a tablet\u00a0and\u00a0after some time the user buys a new device and gives away the old one.<\/p>\n<p>Users then do a factory reset and that\u2019s it for them\u2026 But the mobile device is still registered in your Exchange Organization.<\/p>\n<p>If you use the PowerShell command:<\/p>\n<pre>Get-ActiveSyncDeviceStatistics -Mailbox <alias> | fl DeviceModel, LastSyncAttemptTime, Identity, DeviceID<\/pre>\n<p>You can check how many Devices one User has. In my case by about\u00a05\u2019000 warm Body Mailboxes we had over 10\u2019000 mobile devices.<\/p>\n<p>The primary problem is not the amount of the devices, the problem is that old and not longer used devices are still registered in the Exchange Organization.<\/p>\n<p>To clean up all old devices manually by hand is not an option! \u00a0So the solution was PowerShell!<\/p>\n<p>First I needed to create a variable for the scope target how long back I want to delete unused devices. For this I defined a variable for \u2018Last Sync attempt Time\u2019.<\/p>\n<p>So you can run the script like in the pic bellow:<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-414\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-1.png\" alt=\"\" width=\"581\" height=\"230\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-1.png 442w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-1-300x119.png 300w\" sizes=\"(max-width: 581px) 100vw, 581px\" \/><\/p>\n<p>Collecting the data can take some time! It depends on your Exchange Organization.<\/p>\n<p>After the first collecting, you will see a progress bar wich shows the current status. You can also see details about the progress in the Exchange Management Shell:<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-415\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-2.png\" alt=\"\" width=\"584\" height=\"222\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-2.png 584w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-2-300x114.png 300w\" sizes=\"(max-width: 584px) 100vw, 584px\" \/><\/p>\n<p>After some time the collecting of the information will be done and the script makes a STOP.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-416\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-3.png\" alt=\"\" width=\"496\" height=\"62\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-3.png 432w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-3-300x38.png 300w\" sizes=\"(max-width: 496px) 100vw, 496px\" \/><\/p>\n<p>After the stop it will automatically open your CSV File which shows you ALL mobile devices which will be removed from your Exchange Organization. Here you have the last chance to modify the entries for the deletion:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-417\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-4-300x170.png\" alt=\"\" width=\"499\" height=\"283\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-4-300x170.png 300w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-4-600x341.png 600w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-4-768x436.png 768w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-4-1024x582.png 1024w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-4-780x443.png 780w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-4.png 1111w\" sizes=\"(max-width: 499px) 100vw, 499px\" \/><\/p>\n<p>After you checked the CSV file, just go back to your Exchange Management Shell and press ENTER.<\/p>\n<p>Now the removal progress starts:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-418\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-5-300x177.png\" alt=\"\" width=\"497\" height=\"293\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-5-300x177.png 300w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-5.png 477w\" sizes=\"(max-width: 497px) 100vw, 497px\" \/><\/p>\n<p>At the end you will get the notice that the defined mobile devices were deleted.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-419\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-6.png\" alt=\"\" width=\"577\" height=\"38\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-6.png 577w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-6-300x20.png 300w\" sizes=\"(max-width: 577px) 100vw, 577px\" \/><\/p>\n<p>So now you\u2019re done\u2026 Almost! The Script also creates two Log Files, one for the successful removes and one for the errors. These files will be saved in the script path.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-420\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-7.png\" alt=\"\" width=\"583\" height=\"94\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-7.png 583w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/09\/S-7-300x48.png 300w\" sizes=\"(max-width: 583px) 100vw, 583px\" \/><\/p>\n<p>Now you are done with removing the old mobile devices\u2026<\/p>\n<p>I hope this script will help you\u00a0with your operational tasks and you will enjoy it.<\/p>\n<p>The last question is, where can you download this script?<\/p>\n<p>You can find it in the <a href=\"https:\/\/gallery.technet.microsoft.com\/Remove-old-EAS-Devices-48074696?redir=0\">Technet Gallery<\/a>.<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>Photo by\u00a0<a href=\"https:\/\/unsplash.com\/photos\/pM9pkc9J918?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText\">Michael Dziedzic<\/a>\u00a0on\u00a0<a href=\"https:\/\/unsplash.com\/search\/photos\/remove?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText\">Unsplash<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Earlier this month I had to make some cleanups\u00a0in a customer\u2019s Exchange infrastructure. On one side, I had to identify empty Distribution Groups and on the other side I had to clean up unused Mobile Devices (Active Sync) partnerships. The Exchange Organization contains more than 5\u2019000 warm Body (User) Mailboxes from which almost everyone has [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3574,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[2,3],"tags":[],"class_list":["post-413","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-exchange","category-powershell"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/posts\/413","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=413"}],"version-history":[{"count":9,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/posts\/413\/revisions"}],"predecessor-version":[{"id":3575,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/posts\/413\/revisions\/3575"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/media\/3574"}],"wp:attachment":[{"href":"https:\/\/www.msb365.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}