Good day,
I need to swap around 200 users’ primary SMTP as below
Current
SMTP:usernameATdomain1.co.uk
smtp:usernameATdomain2.co.uk
Change to
SMTP:usernameATdomain2.co.uk
smtp:usernameATdomain1.co.uk
This is what I have so far but it does not error and does to change anything.
$ASLUsers = Get-ADUser -Filter * -SearchBase "OU=Testing,OU=Permanent-SSC,OU=ASLSSC,OU=staff,DC=asl,DC=lan"
foreach($ASLUsers in $ASLUsers)
{
Set-ADUser -Identity $ASLUsers.samaccountname -remove @{Proxyaddresses="SMTP:" + $ASLUsers.samaccountname + "ATdomain1.co.uk"}
Set-ADUser -Identity $ASLUsers.samaccountname -remove @{Proxyaddresses="SMTP:" + $ASLUsers.samaccountname + "ATdomain2.co.uk"}
}