Download and edit the script and update lines 2 & 3 with the old LEM IP/Hostname and the new LEM IP/Hostname.
This script also assumes:
Wow that's some awesome powershell you did there! Thanks a bunch for this chad.every!
Thanks!!! You saved us a bunch of time!!