I have a domain xyz.com in AWS Directory Service, and I am trying to join an EC2 instance to this domain using PowerShell. I can do it manually but I am trying to automate it so that when the next instance spins up I can use this script to get things done. So, here's my script:
New-DSComputer -ComputerName "test" -DirectoryId directoryid -OrganizationalUnitDistinguishedName "CN=Computers,DC=xyz,DC=com" -Password password
Restart-Computer
I can see my instance name registered in the domain computers (dsa.msc) - but if I open the properties, there's no dns name for the instance. And in the client instance I can see the machine joined to the Workgroup and not the domain xyz.com
Tried after using DNS servers, no success. No logs in event viewer either. How can I join this instance to the domain?
0 Answers