Before running the below script, it's necessary to mark certain IIS App pools and websites…