Reanming the Auto Discover File for Outlook 2010

Hi Folks - I am a novice with Powersehll just to get that out of the way, so sorry if I come off as a noob.

I am trying to figure out how to write a PS script that will connect to a remote computer or computers and rename the Auto Discover file for my company.

We are Migrating to office 365 from on Prem and the Auto discover needs to be renamed so the Outlook client can point to 365. If the file doesn’t exist I want to script to ignore it and complete.

For example - raneme on remote Computer A mycompany.com.xml to mycompany.com.old in path c:\program files (x86)\office…

Anyone have a code snippet like that available?

Thanks in advance

Did you think about using Group Policies to acomplish what you need? If you still want to go with a script - did you search for it in the Microsoft Technet Script Center or the Powershellgallery?
If you want to do it by yourself you could start with a source for your computernames like a text file or a CSV file. Then you could use a foreach loop to iterate through all your computers, check first if they are online and if they are use psremoting to connect them and rename whatever you want.

As an Exchange and 365 admin I have to say that manually renaming autodiscover files is the wrong approach. You should setup the correct DNS records for this like Microsoft recommends.