need a script to delete proxy addresses from AD.
The script needs to delete only a specific proxy address from each user.
john.smith.mx360@contoso.com
I have the script to get the information, unfortunately, I was only able to figure out how to output it to a text file, but is hard to read. In any case, I got the info I need and have the email addresses and I've into a spreadsheet and saved it to C:\Tem\proxiestoremove.csv. I could not figure out how to do this as a batch but only one by one. Note am in a hybrid organization and needs to be done from AD as Exchange won't work.
There are 83 emails to remove and they are not all from the same user.
82 users = 83 emails to remove (1 from each user)
Import-Module ActiveDirectory
$User = Get-ADUser john.smith -Properties proxyAddresses
$User.proxyAddresses.Remove("smtp:john.smith.mx360@contoso.com")
Set-ADUser -instance $User
Thanks