- Newest
- Most votes
- Most comments
Cause 1 (Most likely): An AMI is being created directly from a domain-joined instance without running Sysprep.
Solution:
When creating a new AMI, remove the source instance from the domain and run Sysprep before creating the AMI. Alternatively, we recommend using a tool like Amazon EC2 Image Builder and modifying your design so that domain joining occurs dynamically after instance launch—using EC2Launch v2 or UserData scripts (keeping the "Golden AMI" itself in a non-domain-joined state is a best practice).
Cause 2: A security group with no outbound rules is completely blocking communication with the Domain Controller (DC).
Solution: Add outbound rules to allow traffic to the Domain Controller on at least the following ports:
| Port | Protocol | Purpose |
|---|---|---|
| 53 | TCP/UDP | DNS |
| 88 | TCP/UDP | Kerberos authentication |
| 389 | TCP/UDP | TCP/UDP |
| 445 | TCP | SMB |
| 464 | TCP/UDP | Kerberos password change |
| 3268-3269 | TCP | Global Catalog (if required) |
I cannot remove that domain. So I was following this:
https://repost.aws/knowledge-center/ec2-windows-ami-domain-join
I have completed till Step 3, but after that not able to connect through local administrator. Showing Logon attempt failed.
Few points to check
- SG by default blocks all inbound traffic. So please enable inbound traffic to allow login to instance.
- SG by default allow outbound traffic as SG is stateful way to protect your instances
answered 19 days ago
I have allowed RDP 3389 inbound rule. I have removed all outbound rules as instructed in the documentation link that I shared
Relevant content
asked 3 years ago
- AWS OFFICIALUpdated 5 months ago

I cannot remove that domain. So I was following this:
https://repost.aws/knowledge-center/ec2-windows-ami-domain-join
I have completed till Step 3, but after that not able to connect through local administrator. Showing Logon attempt failed.