Script Sample - Check Azure Site Recovery (ASR) Prerequisite Services
@20aman Aug 20, 2018When you want to use Azure Site Recovery (ASR) either for Migration or for Disaster Recovery (DR), you will need to enable replication. Under the hood, this involves installation of the Mobility Services agent. This has few pre-requisites for some services to be enabled and set up appropriately.
If you have a large environment then you can do this in an automated fashion by leveraging this script sample. You can learn more about these services related requirements by checking the "Checking Services" section in here: Troubleshooting Azure Site Recovery (ASR) - Data Replication Initiation Issues - Part 2
How it works
This script will query the remote computers and check for service status for the 3 ASR Required services, and export to CSV. These 3 services are:
- Volume Shadow Copy(VSS)
- COM+ System Application(COMSysApp)
- Microsoft Distributed Transaction Coordinator Service (MSDTC)
The script uses WMI to fetch the data from the remote computer(s) and checks if these services are in the "running" state and whether or not the startup type is set to "automatic". If both conditions are not met then the state is reported as "Set Incorrectly". If both conditions are met then the result is reported as "Set Correctly"
Location of the Script
You can find this script in GitHub at this location: Check-ASRPrerequisiteServices.ps1 on GitHub
Next Script - Setting these services automatically
Next, we will check the script sample to set these services appropriately. This sample can be found here: Script Sample - Set Azure Site Recovery (ASR) Pre-requisite Services