windowsjenkinschef-infrawinrm

WinRM: ERROR - Failed to authenticate to 172.x.x.x. WinRM::WinRMAuthorizationError


I'm trying to execute some chef commands on a Windows server using Jenkins.

When I run the build on Jenkins to execute the chef commands, I get the error below:

ERROR: Failed to authenticate to 172.54.78.989 as demo-user
Response: WinRM::WinRMAuthorizationError
Hint: Make sure to prefix domain usernames with the correct domain name.
Hint: Local user names should be prefixed with computer name or IP address.
EXAMPLE: my_domain\user_namer
ERROR: WinRM::WinRMAuthorizationError: WinRM::WinRMAuthorizationError
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE 

Trying to figure out how to fix this


Solution

  • I was able to fix the issue

    It was caused by my user (demo-user) not belonging to domain name that is allowed to connect from Chef to the Windows Server.

    All I had to do was to get a user that was part of my organization domain name, replace demo-user with that user in my chef commands, and then run the Jenkins build again.

    This time it worked fine.