Thanks Ross for your contentious efforts, Unfortunately the script still errors out
aPS D:\> $email = Read-Host "Please enter the user's email address"
$device = Get-ActiveSyncDevice -mailbox $email | fl DeviceUserAgent
foreach ($item in $device)
{
if ($device -ne "BB*, WorxMail*")
{
Remove-ActiveSyncDevice $email - Confirm:$True
}
}
Please enter the user's email address: emailAddress@domain.com
WARNING: The Get-ActiveSyncDevice cmdlet will be removed in a future version of Exchange. Use the Get-MobileDevice cmdlet
instead. If you have any scripts that use the Get-ActiveSyncDevice cmdlet, update them to use the Get-MobileDevice cmdlet.
For more information, see http://go.microsoft.com/fwlink/p/?LinkId=254711.
WARNING: The Get-ActiveSyncDevice cmdlet will be removed in a future version of Exchange. Use the Get-MobileDevice cmdlet
instead. If you have any scripts that use the Get-ActiveSyncDevice cmdlet, update them to use the Get-MobileDevice cmdlet.
For more information, see http://go.microsoft.com/fwlink/p/?LinkId=254711.
A positional parameter cannot be found that accepts argument '-'.
+ CategoryInfo : InvalidArgument: (:) [Remove-ActiveSyncDevice], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Remove-ActiveSyncDevice
+ PSComputerName : serverFQDN
A positional parameter cannot be found that accepts argument '-'.
+ CategoryInfo : InvalidArgument: (:) [Remove-ActiveSyncDevice], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Remove-ActiveSyncDevice
+ PSComputerName : serverFQDN
A positional parameter cannot be found that accepts argument '-'.
+ CategoryInfo : InvalidArgument: (:) [Remove-ActiveSyncDevice], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Remove-ActiveSyncDevice
+ PSComputerName : serverFQDN
A positional parameter cannot be found that accepts argument '-'.
+ CategoryInfo : InvalidArgument: (:) [Remove-ActiveSyncDevice], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Remove-ActiveSyncDevice
+ PSComputerName : serverFQDN
A positional parameter cannot be found that accepts argument '-'.
+ CategoryInfo : InvalidArgument: (:) [Remove-ActiveSyncDevice], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Remove-ActiveSyncDevice
+ PSComputerName : serverFQDN
A positional parameter cannot be found that accepts argument '-'.
+ CategoryInfo : InvalidArgument: (:) [Remove-ActiveSyncDevice], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Remove-ActiveSyncDevice
+ PSComputerName : serverFQDN