locked
run script on remote machine RRS feed

  • Question

  •  

     I'm trying to run this script against a remote machine(not on the Network). I created a local acct on this machine
    and can sign in and run the script with this credentials. Script prompts for password when I call it but says user
    or password in correct.

    Invoke-Command -ComputerName dzerp1 -ScriptBlock {"d:\sxace\cmds\test.cmd"} -credential agntjobs

     Thanks.

    Friday, April 13, 2018 2:52 PM

Answers

  • You cannot use normal authentication when you are not on a domain.  You must set up CredSSP between non-domain systems.


    \_(ツ)_/

    • Marked as answer by hart60 Sunday, April 15, 2018 1:40 PM
    Friday, April 13, 2018 4:29 PM

All replies

  • Double check the username and password you have used, if the other machine is on a domain then you will have to account for that.

    Invoke-Command -ComputerName dzerp1 -FilePath d:\sxace\cmds\test.cmd -Credential DOMAIN\USERNAME


    Learn PowerShell                     Script Requests

    -Remember to mark the correct response as the answer-

    Friday, April 13, 2018 3:17 PM
  •  Not on Domain  and have checked and re-checked password. Any way to debug?

     THanks.

    Friday, April 13, 2018 4:22 PM
  • You cannot use normal authentication when you are not on a domain.  You must set up CredSSP between non-domain systems.


    \_(ツ)_/

    • Marked as answer by hart60 Sunday, April 15, 2018 1:40 PM
    Friday, April 13, 2018 4:29 PM
  • like jrv mentioned , use CredSSP.

    more info at below link,

    https://codingbee.net/tutorials/powershell/powershell-use-credssp-to-run-commands-remotely-with-fewer-issues


    Regards kvprasoon

    Saturday, April 14, 2018 4:05 PM
  •  Thanks... will try CredSSP

    Sunday, April 15, 2018 1:41 PM