We, Microsoft Exchange Admins, usually or frequently edit hosts file to verify some changes prior to the production. The below script will enable you to modify (adding or removing host entries) the hosts file from a remote computer. The script will also record the machine names against the host entries are changed.
There are two scripts, first one to add the entries to the hosts file, and the second one for removing it once any testing is completed.
You need to enter the list of computers for which the hosts file needs to be edited in the file c:\Script\ComputerList.txt. You may use a different path and file name, but remember to amend the script accordingly.
Following script will help you remove the temporarily added hosts entries for list of computers.
In both the script, I have added a time wait to avoid network file editing errors. Which means, if the script executes really fast, the lock on the file might create writing errors. A slight time wait function will manage this situation efficiently.
Share your comments if any.
Couple of times in the past, I observed this behavior that the database copy status turns to DisconnectedAndResynchronizing from DisconnectedAndHealthy after removing the activation restriction.
This situation arise because, the copy try to replay the recent logs from other nodes. If your database copy could not find any copy to copy the pending logs, the status would stay the same for longer period.
If you wish to have 2 DAG cluster with one of the cluster node as DR instance, then it is not a good idea to keep the ActivationSuspended parameter to true. Following are the approach you should consider to ensure a seamless recovery in case of a failover.
1. Disable the ActivationSuspended value in the second node
2. The database would failover immediately in the event of a node failure.
1. Enable the ActivationSuspended value in the DR node
2. In the event of active node failure, follow the DR procedure to evict the failed node prior to release the Activation suspension
It is recommended that, activation suspension can be released either when the nodes are available or after evicting failed nodes from the DAG cluster.