Find all users that have a proxyAddresses entries starting with ":" and then remove the whole string.
From MyWiki
The Challenge Find all users that have a proxyAddresses entries starting with ":" and then remove the whole string. Ensure the code works with v2 of PowerShell.
The Solution
$users = Get-ADUser -Filter {ProxyAddresses -like ":*"} -Properties ProxyAddresses if ($users) { foreach ($user in $users) { $OddProxies = $user.ProxyAddresses | where-object {$_ -like ":*"} foreach ($OddProxy in $OddProxies) { Set-ADUser -Identity $user -Remove @{ProxyAddresses = "$($OddProxy)"} } } } </powershell>