The below script may be utilized to change the OS server name post launch.
FOR /F "usebackq" %%i IN (`hostname`) DO SET HOSTNAME=%%i
ECHO Current server name is %HOSTNAME%. Changing to AWS-%HOSTNAME%
WMIC computersystem where caption='%HOSTNAME%' rename 'AWS-%HOSTNAME%'
IF %ERRORLEVEL% NEQ 0 (
ECHO Failed to change server name.
ECHO Server name was changed successfully. Restarting....
shutdown -t 30 -r
The information provided above is for general guidance only. The information is provided on "AS IS" basis, with no guarantee of completeness, accuracy or timeliness, and without warranty or representations of any kind, expressed or implied. In no event will CloudEndure and/or its subsidiaries and/or their employees or service providers be liable to you or anyone else for any decision made or action taken in reliance on the information provided above or for any direct, indirect, consequential, special or similar damages (including any kind of loss), even if advised of the possibility of such damages. CloudEndure is not responsible for the update, validation or support of scripts.
For information on executing post launch scripts refer to this FAQ