[error]Unable to create pssession. Error: 'Connecting to remote server 192.168.2.33 failed with the following error message : The WinRM client cannot process the request. Default authentication may be used with an IP address under the following conditions: the transport is HTTPS or the destination is in the TrustedHosts list, and explicit credentials are provided. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. For more information on how to set TrustedHosts run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic.'
Getting this error i have actived https ports as well if you can help me with it
CodePudding user response:
This error message is thrown when you try to connect with an IP address instead of a hostname
or FQDN
(fully qualified domain name).
To use an IP address, you must either use WinRM over HTTPS or add the IP address to the TrustedHosts list on the target system.
These steps are mainly relevant when trying to connect from workgroup-based computers.
Within an Active Directory, WinRM will use Kerberos for authentication, and this requires you either use the hostname
or the FQDN
of the target system you’re connecting to.
So, please try using the hostname
or FQDN
(like ComputerName.test.com
) instead of the IP to check if it works. If that doesn't work, then please double check your WinRM configuration. Configure WinRM for your reference.
CodePudding user response:
Instead of using powershell on target machine just setup agent on your machine and use powershell task in CI/CD. It's an easiest way.