Jump to content

Recommended Posts

Posted (edited)

Hello,

 

I am retiring an old domain. We have a large number of users that have this domain as a proxy address in AD. This was to provide a second email address in Office 365 whilst they change everything to the new domain.

 

Does anyone have a script the will search users and remove any proxy address that contains the old domain please?

 

I can't use any commands that require exchange. We don't have a on premise server and can't run them on Office 365 due to DirSync.

 

I did have one, but I can't find it nor can I find one of Google.

 

Thanks

Edited by FN-GM
Posted

I have made this. It does search the right users but doesn't delete the proxy address. I assume its the wildcard in Set-ADUser

 

Get-ADuser -SearchBase "OU=ouname,DC=domain,DC=local" -ldapFilter "(&(proxyaddresses=smtp:*@olddomain.com*))" | Set-ADUser -Remove @{ProxyAddresses="smtp:*@olddomain.com"}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...