multiple servers script should be for fewer machines.
You should use other methods like GPO, Sccm or Ansible
Can you check the Service Principal: https://learn.microsoft.com/en-us/azure/azure-arc/servers/onboard-service-principal#create-a-service-principal-for-onboarding-at-scale