Last active
January 20, 2023 18:25
-
-
Save jcefoli/608b4356a547d51b62f7 to your computer and use it in GitHub Desktop.
IIS Websites and Apppools Delete/Import/Export Cheat Sheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM Delete all Websites | |
%windir%\system32\inetsrv\appcmd list site /xml | %windir%\system32\inetsrv\appcmd delete site /in | |
REM Delete all App Pools | |
%windir%\system32\inetsrv\appcmd list apppool /xml | %windir%\system32\inetsrv\appcmd delete apppool /in | |
REM Export all the Application Pools: | |
%windir%\system32\inetsrv\appcmd list apppool /config /xml > C:\apppools.xml | |
REM Import all the Application Pools: | |
%windir%\system32\inetsrv\appcmd add apppool /in < C:\apppools.xml | |
REM Export all Websites: | |
%windir%\system32\inetsrv\appcmd list site /config /xml > C:\sites.xml | |
REM Import all Websites: | |
%windir%\system32\inetsrv\appcmd add site /in < C:\sites.xml | |
REM Recycle Individual App Pool | |
%windir%\system32\inetsrv\appcmd.exe recycle apppool /apppool.name:DefaultAppPool | |
REM When importing web sites on another host, note the IP bindings will be incorrect and may need to be adjusted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Update only property in pool
appcmd.exe set AppPool -processModel.identityType:SpecificUser /in < C:\apppools.xml