Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional server argument to allow join to specific domain controller. #131

Closed
ddmrb opened this issue Jun 29, 2024 · 3 comments · Fixed by #134
Closed

Add optional server argument to allow join to specific domain controller. #131

ddmrb opened this issue Jun 29, 2024 · 3 comments · Fixed by #134

Comments

@ddmrb
Copy link

ddmrb commented Jun 29, 2024

SUMMARY

Add optional server argument to allow join to specific domain controller.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

microsoft.ad.membership

ADDITIONAL INFORMATION

In large environments with globally distributed domain controllers, a random domain controller is chosen during the join process. After joining and rebooting, the host may fail to log in to the domain because the join might have been completed on a remote domain controller. In such cases, the domain replication changes may not have propagated to the domain controller handling the login request. Assigning a specific domain controller will avoid this issue. See -server parameter from add-computer cmdlet:
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/add-computer?view=powershell-5.1

- name: join host to ansible.vagrant with automatic reboot
  microsoft.ad.membership:
    dns_domain_name: ansible.vagrant
    hostname: mydomainclient
    domain_admin_user: [email protected]
    domain_admin_password: password123!
    domain_ou_path: "OU=Windows,OU=Servers,DC=ansible,DC=vagrant"
    server: mynearestloginserver
    state: domain
    reboot: true
@Yannik
Copy link

Yannik commented Jul 1, 2024

I presume that Add-Computer uses DsGetDcName to lookup the DC to use, so it should use the closest one (requires you to have your sites configured correctly). Nonetheless, this feature might be useful in some cases, I do not see a harm in adding it.

@jborean93
Copy link
Collaborator

Thanks for the feature request, this has been implemented with #134 and will be present in the next release.

@ddmrb
Copy link
Author

ddmrb commented Jul 12, 2024

Great, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants