2

I am just beginning to use PS Remoting to administer servers but have run into a snag. When I am at the local server command line, I can run a command like

Get-DfsReplicationGroup

and the prompt returns back a list of my DFS Replication Groups. However, when I am in a remote PSSession to the same server, and run the same command, I receive an error

Value cannot be null.
Parameter name: args
    + CategoryInfo          : NotSpecified: (:) [Get-DfsReplicationGroup], ArgumentNullException
    + FullyQualifiedErrorId : System.ArgumentNullException,Microsoft.DistributedFileSystemReplication.Commands.GetDfsR
   eplicationGroupCommand

I have tried entering a remote session from not only Windows 10 but also from another Server 2012 R2 machine that has the same roles installed. It seems like somehow the command is operating differently depending on where it originates. The remote session appears to be working for other commands (I can change directories, create and delete files okay).

I set up my remote PSSession by:

$cred = Get-Credential
Enter-PSSession Server1 -Credential $cred

What am I missing in my remote-session setup?

5
  • Have you tried importing the session, rather than entering it? This appears very similar: morgantechspace.com/2015/06/…
    – Robin
    Feb 9, 2016 at 15:33
  • I did see that - unfortunately it did not change the error in my situation
    – bsigrist
    Feb 9, 2016 at 15:53
  • Have you tried invoke-command to see if it has a different outcome? $session = New-PSSession Server1 -Credential $cred <br> Invoke-Command -Session $session {Get-DfsReplicationGroup}
    – Lex
    Feb 10, 2016 at 15:26
  • You're missing a piece of the pie. You get this error because there are internal parameters that haven't been set by importing of a module or snapin. Figure out which isn't loaded then load it.
    – Colyn1337
    Feb 10, 2016 at 16:38
  • I attempted the Invoke-Command method as well as Import-Module DFSR and was unsuccessful on both attempts.
    – bsigrist
    Feb 11, 2016 at 16:33

0

You must log in to answer this question.

Browse other questions tagged .