Change ID of website in IIS

This script will change the ID of a site for you in IIS. You will need to save the output as a .bat file

February 16, 2012

REM STOP the IIS sites before renaming the site id
CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\adsutil.vbs STOP_SERVER W3SVC/%{current_site_id}%

REM Rename Site ID
CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\adsutil.vbs MOVE W3SVC/%{current_site_id}% W3SVC/%{new_site_id}%

REM Start Site
CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\adsutil.vbs START_SERVER W3SVC/%{new_site_id}%