- Newest
- Most votes
- Most comments
The issue you're experiencing with the InvalidCredentialsError when using Python Winrm to connect to an AppStream Image Builder could be related to a few factors:
-
Local Administrator Rights: By default, Active Directory domain users do not have local administrator rights on AppStream 2.0 image builder instances. Even if you've created a user with admin rights, there might be additional steps needed to grant proper local administrator access.
-
Active Directory Integration: If your AppStream Image Builder is joined to an Active Directory domain, there might be complications with authentication, especially if smart card sign-in is required.
-
System Environment Variables: Certain system environment variables, particularly those related to AWS CLI credentials, might interfere with AppStream 2.0's ability to manage the image builder.
To troubleshoot this issue:
-
Verify that the user account you're using has proper local administrator rights on the image builder. You may need to use Group Policy preferences in your directory or manually grant these rights using the local administrator account on the image builder.
-
Double-check the credentials stored in Secrets Manager to ensure they are correct and up-to-date.
-
If you're using Active Directory, make sure the computer object for the image builder hasn't been deleted or disabled in the AD domain. You might need to enable or reset the computer object in Active Directory.
-
Review any system environment variables you've set, especially those related to AWS CLI credentials, as they might be interfering with the authentication process.
-
Ensure that the WinRM service is properly configured and running on the image builder. You may need to check the WinRM settings and security configuration.
If these steps don't resolve the issue, you may need to review the IAM roles and permissions associated with your AppStream resources, or contact AWS Support for further assistance.
Sources
Granting Local Administrator Rights on Image Builders - Amazon AppStream 2.0
Change System Environment Variables - Amazon AppStream 2.0
Troubleshooting Notification Codes - Amazon AppStream 2.0
The solution outlined in my blog article is very similar to what you are looking to accomplish and outlines how to configure WinRM for use with PyWinRM.
Relevant content
- asked 2 years ago