Get the details of an Active Directory user object.
data "ad_user" "u" {
user_id = "DC3E5929-71C0-4232-9C32-9C7AFAABF0BB"
}
output "username" {
value = data.ad_user.u.sam_account_name
}
output "country" {
value = data.ad_user.u.country
}
output "trusted_for_delegation" {
value = data.ad_user.u.trusted_for_delegation
}
data "ad_user" "u2" {
user_id = "CN=Test User,OU=Users,DC=contoso,DC=com"
}
output "testuser_guid" {
value = data.ad_user.u2.id
}
user_id
(String) The user's identifier. It can be the group's GUID, SID, Distinguished Name, or SAM Account Name.id
(String) The ID of this resource.city
(String) City assigned to user object.company
(String) Company assigned to user object.country
(String) Country assigned to user object.department
(String) Department assigned to user object.description
(String) Description of the user object.display_name
(String) The display name of the user object.division
(String) Division assigned to user object.dn
(String) The distinguished name of the user object.email_address
(String) Email address assigned to user object.employee_id
(String) Employee ID assigned to user object.employee_number
(String) Employee Number assigned to user object.fax
(String) Fax number assigned to user object.given_name
(String) Given name of the user object.home_directory
(String) Home directory of the user object.home_drive
(String) Home drive of the user object.home_page
(String) Home page of the user object.home_phone
(String) Home phone of the user object.initials
(String) Initials of the user object.mobile_phone
(String) Mobile phone of the user object.office
(String) Office assigned to user object.office_phone
(String) Office phone of the user object.organization
(String) Organization assigned to user object.other_name
(String) Extra name of the user object.po_box
(String) Post office assigned to user object.postal_code
(String) Postal code of the user object.principal_name
(String) The principal name of the user object.sam_account_name
(String) The SAM account name of the user object.sid
(String) The SID of the user object.smart_card_logon_required
(Boolean) Smart card required to logon or notstate
(String) State of the user object.street_address
(String) Address of the user object.surname
(String) Surname of the user object.title
(String) Title of the user objecttrusted_for_delegation
(Boolean) Check if user is trusted for delegation