Powershell script to append multiple entries on Windows Hosts file to list of servers? RRS feed

  • Question

  • I Have a list of servers which requires adding 2 entries on hosts file remotely but could'nt find the script.
    Tuesday, June 23, 2020 7:09 PM

All replies

  • Try this one. One of the examples will match your situation:


    --- Rich Matheisen MCSE&I, Exchange Ex-MVP (16 years)

    Tuesday, June 23, 2020 8:11 PM
  • I would prefer add-content over out-file or >>, so that ascii and unicode encodings aren't mixed.
    • Edited by JS2010 Thursday, June 25, 2020 4:51 PM
    Thursday, June 25, 2020 4:50 PM
  • Hi,
    Was your issue resolved? 
    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.
    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.
    If no, please reply and tell us the current situation in order to provide further help.
    Best Regards,
    Yang Yang

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, July 3, 2020 5:45 AM