need a script to delete proxy addresses from AD.
The script needs to delete only a specific proxy address from each user.
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:email@example.com") Set-ADUser -instance $User