2

I am facing a peculiar problem in executing chef knife commands for PowerShell remotely.

Command is executed successfully, however the return code is 1 with an error.

> %CPath% && knife winrm '%IP_Val%' --winrm-shell Powershell 'query session' -x %username% -p %password%  -m

%IPAddress%  SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE
%IPAddress% >services                                    0  Disc
%IPAddress%  console                                     1  Conn
%IPAddress%                    %Username%          3  Disc
%IPAddress%  rdp-tcp                                 65536  Listen
ERROR: Failed to execute command on %IPAddress% return code 1

1 Answer 1

2

Looks like its something to do with WinRM. I replaced "query session" with "qwinsta" which solved the problem.

Need to check RCA on Winrm

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .