I am trying to create a custom command that will wipe the users phones. The it seems the power shell is not taking the Variable %username%. Please see below
Import-Module Adaxes
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
Add-PSSnapin Microsoft.Exchange.Management.Powershell.Support
$Target = %username%
Get-ActiveSyncDeviceStatistics -Mailbox $Target | foreach { Clear-ActiveSyncDevice $_.Identity -Confirm }
IS there and way to get it to take "$Target" in ther Get command?