title: Removing the device partnership in Exchange 2010 using Powershell
body: <p>I'm trying to create a script that will remove the mobile phone partnership from a user in Exchange 2010.  My plan of implementation was to use Get-ActiveSyncDeviceStatistics to find the identity of the mobile device then use Remove-ActiveSyncDevice to remove it.  However, I cant seem to get the identity into a variable.  I've tried 2 methods that done seem to work which are</p>
  
  <p>Method 1:</p>
  
  <pre><code>$UserMailbox = Get-ActiveSyncDeviceStatistics -Mailbox R68Fred
  Remove-ActiveSyncDevice -Identity $UserMailbox.identity -Confirm $true
  </code></pre>
  
  <p>Method 2:</p>
  
  <pre><code>Get-ActiveSyncDeviceStatistics -Mailbox R68Fred | Select-Object -Property "Identity"
  </code></pre>
  
  <p>I'm still fairly new to Powershell so I dont know if my plan of attack is correct so I appreciate any advice in the matter.</p>