I was looking for a way to do the same and found this thread. There is not much out there on how to create one, so after some trial and error I figured out how to create the connection object. This is a one liner to create an ntdsconnection object.
You will have to write your code to loop through your different sites, but here is the code. Two years late, but hopefully can help someone else.
New-ADObject-typentdsConnection-Name MyConnectionObject-path"CN=NTDS
Settings,CN=8R2RODC1,CN=Servers,CN=RODC-Site,CN=Sites,CN=Configuration,DC=contoso,DC=com"-ProtectedFromAccidentalDeletion$True-OtherAttributes@{options=65;
fromServer='CN=DC1,OU=Domain
Controllers,DC=contoso,DC=com';enabledConnection=$True}