Solved

Removing ActiveSync devices from specific servers

Posted on 2014-10-24
3
218 Views
Last Modified: 2014-10-29
I have 3 exchange server in my environment and I'd like to remove old active sync partnerships (older than last sync 90 days) from each server individually.

Is there a way to run this command on a specific server?

Get-ActiveSyncDevice -ResultSize unlimited | Get-ActiveSyncDeviceStatistics | where {$_.LastSyncAttemptTime -lt (get-date).adddays(-90)} | foreach-object {Remove-ActiveSyncDevice ([string]$_.Guid) -confirm:$false}
0
Comment
Question by:toby_amsterdam
3 Comments
 
LVL 8

Expert Comment

by:tshearon
ID: 40401901
Activesync device partnerships are partnered to user account, not servers. And yes you can remove them with powershell.
0
 
LVL 12

Accepted Solution

by:
SreRaj earned 500 total points
ID: 40401903
Hi,

Please try the following.


$Mailboxes = Get-CASMailbox -Filter {hasactivesyncdevicepartnership -eq $true} -resultsize unlimited | Get-Mailbox | where{$_.servername -eq "MailboxServerName"}
ForEach($Mailbox in $Mailboxes){Get-ActiveSyncDeviceStatistics -Mailbox $Mailbox.Identity | where {$_.LastSyncAttemptTime -lt (get-date).adddays(-90)} | Remove-ActiveSyncDevice}
0
 

Author Comment

by:toby_amsterdam
ID: 40406606
Can I also use this to export the results before deleting?

$Mailboxes = Get-CASMailbox -Filter {hasactivesyncdevicepartnership -eq $true} -resultsize unlimited | Get-Mailbox | where{$_.servername -eq "MailboxServerName"}
ForEach($Mailbox in $Mailboxes){Get-ActiveSyncDeviceStatistics -Mailbox $Mailbox.Identity | where {$_.LastSyncAttemptTime -lt (get-date).adddays(-90)} | Export-CSV c:\activesync.csv}
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
In this video we show how to create a Contact in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Contact ta…
In this video we show how to create an Accepted Domain in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Ac…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now