IIS backup and restore

How to easily create the backup of IIS websites, application pools and configuration and restore them, using appcmd.