using dfsr commands remotely

I have a need to execute dfsr commands like 'Get-DfsrConnection' against a computer remotely. Running locally on a Windows 2012 R2 server works fine, but issuing the command via 'invoke-command -computer $server -scriptblock { Get-DfsrConnection }' fails. I've also attempted passing creds and setting auth to Credssp; which still fails. (Winrm is set up). I've also attempted using enter-pssession and executing from there.. same errors.

Error output:

Could not get the DFSR connection with replication group: "*"; sending computer: ; receiving computer: ; GUID: None
specified An operation error occurred.
    + CategoryInfo          : NotSpecified: (DFSR connection... None specified:String) [Get-DfsrConnection], DfsrExcep
   tion
    + FullyQualifiedErrorId : Get-DfsrConnection.OMException,Microsoft.DistributedFileSystemReplication.Commands.GetDf
   srConnectionCommand
    + PSComputerName        : xxxxxxxxxxxxxx


  • Edited by xjdan89 Wednesday, December 10, 2014 8:19 PM
December 10th, 2014 8:18pm

Hi Xjdan89,

I tested the cmdlet Get-DfsrConnection remotely with the "Enter-Pssession", it can work:

If there is anything else regarding this issue, please feel free to post back.

Best Regards,

Anna Wang

Free Windows Admin Tool Kit Click here and download it now
December 11th, 2014 8:44am

Agreed. It should work. However, my experience using the exact same approach is different. Here's my output.

December 11th, 2014 3:13pm

Hi Xjdan89,

It seems you remote accesses server 2012 r2 from server 2012, Please try to use domain admin account to remote access Server 2012 r2 on server 2012 in case of permission issue.

In addition, according to the error "Could not get the DFSR connection with replication group: "*"; ", please also try to specify the dfsr replication name like below and check if this issue persisit:

 Get-DfsrConnection -GroupName "RG24" -SourceComputerName "SRV01" -DestinationComputerName "SRV02"

If there is anything else regarding this issue, please feel free to post back.

Best Regards,

Anna Wang


Free Windows Admin Tool Kit Click here and download it now
December 12th, 2014 1:31am

The account being used is a Domain Admin. I continue to get the error, even when specifying the specific parameters. You are correct in that I am going from a 2012 server to a 2012 R2 server.

December 12th, 2014 4:13pm

Hi Xjdan,

Please try to run the cmdlet "Get-DfsrConnection" on server 2012 R2 locally, and then use the same account credentail when remote access server 2012 r2 from server 2012:

Enter-PSSession -ComputerName $server2012r2 -Credential $thesamecredentail

If there is anything else regarding this issue, please feel free to post back.

Best Regards,

Anna Wang


Free Windows Admin Tool Kit Click here and download it now
December 15th, 2014 3:02am

I have and it works locally just fine. This problem is only in a WinRM session.
December 15th, 2014 4:15pm

Hi xjdan89.

It's look like second hop issue. Checkout this, this and this one.

Hope this help.

Free Windows Admin Tool Kit Click here and download it now
March 5th, 2015 3:45am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics