Skip to main content
Solved

Playbook to execute a powershell script not working

  • January 6, 2021
  • 4 replies
  • 823 views

Forum|alt.badge.img

I am trying to execute a remote PS script in a windows server using the playbooks. Have kept the script very simple for now to test the execution, but I get the error “ Failed to execute action with error: Internal Error, Connection reset by remote peer.” every time its executed.

  • Execution Start Time: 01/06/21, 5:21:32 PM
  • Execution End Time: 01/06/21, 5:21:32 PM
  • Result: FAILED

Input

Username: serveradmin
Path to Script: E:\NutanixPS\Nutanix-CVM-Post-reboot-checks.ps1
Password: ********
IP Address/Hostname: 10.32.135.100
HTTPS: True
 
Has anyone faced a similar issue and what is the fix?

Best answer by AnishWalia20

Okay, that makes sense @AbhilashT .

Right, it has something to do with this Setting allow “remote connections to this computer”. To be honest I am not sure if this will work with a local account. Is it working with the local admin account? I think you should google about this issue and I am sure you would find something on this. :sweat_smile:

This topic has been closed for replies.

4 replies

AnishWalia20
Nutanix Employee
Forum|alt.badge.img+5
  • Nutanix Employee
  • 178 replies
  • January 6, 2021

Hey, @AbhilashT Happy new year mate.

So have you tried it with HTTPS as false?

So running this playbook requires VMs IP address, Uname, pass, and the path to the script and HTTPS setting, which is all there as you mentioned.

Looks like a connectivity issue to me. It seems the script cannot be executed on the VM due to some connectivity issues. 

Generally, such errors indicate that the remote machine abruptly closed the Transition Control Protocol (TCP) stream. In most instances, a quick reboot of a remote server might solve a temporary outage or connectivity issue.

Can you check the below:

  • The connection to the VM is being blocked due to the Host-Based Access Control Lists.
  • Any firewall rules (Fail2ban, DenyHosts, etc.) not lettings the script to run on the VM.
  • Changes to the SSH daemon configuration file on VM.

Forum|alt.badge.img+16
  • Vanguard
  • 588 replies
  • January 6, 2021

Forum|alt.badge.img
  • Author
  • Adventurer
  • 3 replies
  • January 6, 2021

Thanks Primzy & Anish.

I did some research and found that if I us an external AD account the script is getting executed, all this time I was using a local account that is part of administrators group on the server. But need to find a way to use the local account itself as the AD account password will reset very 24hrs.

I think it has something to do with the below show ‘allow remote connections to this computer’ setting. Have tried unchecking the “allow connections only from the computers running Remote Desktop with Network Level Authentication” option and also tried adding the local account under the ‘select users’ list, but am still getting the same error when trying with the local account.

 

 

Anyone know how to make this work with the local account?

 


AnishWalia20
Nutanix Employee
Forum|alt.badge.img+5
  • Nutanix Employee
  • 178 replies
  • Answer
  • January 6, 2021

Okay, that makes sense @AbhilashT .

Right, it has something to do with this Setting allow “remote connections to this computer”. To be honest I am not sure if this will work with a local account. Is it working with the local admin account? I think you should google about this issue and I am sure you would find something on this. :sweat_smile: