Count of changes is the threshold and depends on how much you expect daily migrations, enter the value based on that.

This will prevent any malicious actor coming into play.

Script will extract the members of the AD group, compare it with Skype online to check who is not enabled for teams only mode and if number is less than the set threshold, it will update the teams upgrade policy to UpgradeToTeams using the below command.