$savepath = “c:\DFSreporting”
Remove-Item $savepath -recurse
DfsrAdmin Health New /RgName:'<replication group name>’ /MemName:<member name> /RefMemName:<where it replicates> /RepName:$savepath\<filename to save the report> /FsCount:true
“The remote session was disconnected because there are no Remote Desktop Licence Servers available to provide a licence.
Please contact the server admnistrator.”
There is also the need to take ownership of the registry key before changing it.Instructions can be found here:https://www.howtogeek.com/262464/how-to-gain-full-permissions-to-edit-protected-registry-keys/
I wanted to add all the users from an OU direct in a group but the problem was that the group had already members.I needed to control wether the user was already member of the group.That is my implementation.