none
Unable to run SETSPN command remotely using INVOKE-COMMAND

    Question

  • Hi All,
    I came across interesting issue where I have a requirement to run SETSPN command remotely using INVOKE-COMMAND Or PSSESSION. 
    When I run the below command directly on my desktop, it runs fine without any issue. 

    setspn -S HOST/MYCNAME -C REDMOND\MYServerName

    But when I use INVOKE-COMMAND option, I'm getting error. Has anyone solved this in the past? Can you suggest me how to solve this puzzle? 

    INVOKE-COMMAND -computername MyServerName {(setspn -S HOST/MyCNAME -C REDMOND\MyServerName)}
    Ldap Error(0x1 -- Operations Error): ldap_get_next_page_s    + CategoryInfo          : NotSpecified:
    (Ldap Error(0x1 ...get_next_page_s:String) [],
    Checking domain DC=redmond,DC=corp,DC=microsoft,DC=com
    Error occurred when searching for existing SPN: 0x00000001
    Error
    Ldap Error(0x1 -- Operations Error): ldap_get_next_page_s
        + CategoryInfo          : NotSpecified: (Ldap Error(0x1 ...get_next_page_s:String) [], RemoteException
        + FullyQualifiedErrorId : NativeCommandError
        + PSComputerName        : MyServerName
    Checking domain DC=redmond,DC=corp,DC=microsoft,DC=com
    Error occurred when searching for existing SPN: 0x00000001



    Wednesday, May 15, 2019 10:35 PM

All replies

  • You cannot run a command that does remote access remotely.  It is not allowed dur to the "second hop restriction".


    \_(ツ)_/

    Wednesday, May 15, 2019 10:57 PM
    Moderator
  • Hi,

    Was your issue resolved?

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.

    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.

    If no, please reply and tell us the current situation in order to provide further help.

    Best Regards,

    Lee


    Just do it.

    Thursday, May 16, 2019 9:25 AM
    Moderator
  • Hi,

    Was your issue resolved?

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.

    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.

    If no, please reply and tell us the current situation in order to provide further help.

    Best Regards,

    Lee



    Just do it.

    Monday, May 20, 2019 6:47 AM
    Moderator