Spent all day battling with this... I built a test domain on azure to play with IIS and DFS etc. To build the script out I had a RDP session to the DC and from there a PSSession to two IIS servers. Adding and removing features and building folder structures was all fine.
Then I started looking at DFS! New-DfsReplicationGroup would ask for the groupname which I would provide and then give me:
New-DfsReplicationGroup : Could not create the replication group named "test". An
operation error occurred.
+ CategoryInfo : NotSpecified: (System.String[]:String[]) [New-DfsReplicati
onGroup], DfsrException
+ FullyQualifiedErrorId : New-DfsReplicationGroup.TerminatingOMException,Microsoft.D
istributedFileSystemReplication.Commands.NewDfsReplicationGroupCommand
For hours I couldn't figure out what the problem. I eventually tried it again by...