Skip to content

Instantly share code, notes, and snippets.

View nycmitch25's full-sized avatar

Michael Quick nycmitch25

  • new york
View GitHub Profile
@nycmitch25
nycmitch25 / Rename.ps1
Last active June 25, 2021 01:12 — forked from timnew/Rename.ps1
Script to Rename Computer without Reboot
<#
.Synopsis
Set Computer Name (HOSTNAME) and Description without rebooting. Author M Quick Date.24/06/2021 Ver. 20210624
.DESCRIPTION
Script sets environment variables and other needed values to change the hostname on a Windows 10 Workstation. The
script also sets the 'description' of the system. The result of the function calls return boolean results. The script
prints out HOSTNAME-DESCRIPTION-CONFIG-SUCCESSFUL if both values were set correctly. This is done so the text can be
captures by the AutoIT script running it and determine pass or fail (easier than getting the exit value).
.EXAMPLE
Rename.ps1 -CN NEWHOSTNAME -DS 'The host description goes here'