none
Remoting AD-Commands doesn't work RRS feed

  • Question

  • Hi,

    I want to use AD-Commands on a client computer in a Domain without installing RSAT.

    I connect to a server, who is able to run AD-commands and import commands with Import-PSSession

    When i run the imported command I get an error. Here is my code:

    $cred = Get-Credential
    $adsess = New-PSSession -ComputerName MPIN -Credential $cred
    Import-PSSession -Session $adsess -CommandName get-aduser
    Get-ADUser name

    I get the following error-message

    Unable to contact the server. This may be because this server does not exist, it is currently down, or it does not have the Active Directory Web Services running.
        + CategoryInfo          : ResourceUnavailable: (hwinter:ADUser) [Get-ADUser], ADServerDownException
        + FullyQualifiedErrorId : ActiveDirectoryServer:0,Microsoft.ActiveDirectory.Management.Commands.GetADUser
        + PSComputerName        : MPIN

    When I name the AD-Server with -Servername nothing changes.

    What is missing or wrong?

    Thanks for help

    Thursday, November 28, 2019 2:48 PM

Answers

  • Hi,

    after sending the question I had a new idea.

    I imported the AD-commands directly from the AD-Server and than it works.

    Before I used another server with installed RSAT-Module.

    Thanks

    • Marked as answer by HWint Thursday, November 28, 2019 2:56 PM
    Thursday, November 28, 2019 2:56 PM

All replies

  • You might read this to learn how to use a remote module: Remoting the Implicit Way.


    Live long and prosper!

    (79,108,97,102|%{[char]$_})-join''

    Thursday, November 28, 2019 2:56 PM
  • Hi,

    after sending the question I had a new idea.

    I imported the AD-commands directly from the AD-Server and than it works.

    Before I used another server with installed RSAT-Module.

    Thanks

    • Marked as answer by HWint Thursday, November 28, 2019 2:56 PM
    Thursday, November 28, 2019 2:56 PM
  • Second hop restriction also applies to AD RSAT.

    Remoting and using AD CmdLets only works if you remote to a DC.


    \_(ツ)_/

    Thursday, November 28, 2019 6:34 PM