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

Terraform AD provider not working in local (windows only) mode while getting computer objects data from multiple domains #184

Open
xvepp01 opened this issue Nov 16, 2023 · 0 comments

Comments

@xvepp01
Copy link

xvepp01 commented Nov 16, 2023

Hi, I am trying to get computer SID with ad_computer data with config as below, but failing. Terraform is running on windows 2016 self-hosted agent in DevOps pipeline under account from domain A while trying to find computer object from domain B.DOMAIN.NET (find computer object from domain A.DOMAIN.NET is working well).

// local (windows only)
provider "ad" {
winrm_hostname = ""
winrm_username = ""
winrm_password = ""
domain_controller = "B.DOMAIN.NET"
}

data "ad_computer" "saapa" {
provider = ad
computer_id = "CN=NAME,DC=B,DC=DOMAIN,DC=NET"
}

Error
Get-ADComputer : Cannot find an object with identity: 'CN=NAME,DC=B,DC=DOMAIN,DC=NET' under: 'DC=A,DC=DOMAIN,DC=NET'

It seems that with local (windows only) config the target domain is not changed based on the domain_controller attribute in ad provider.

Any suggestions?

Thanks a lot.

@xvepp01 xvepp01 changed the title Terraform AD provider not working in local (windows only) mode while getting computer objects data from multiple domain Terraform AD provider not working in local (windows only) mode while getting computer objects data from multiple domains Nov 16, 2023
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

No branches or pull requests

1 participant