summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Preston <stuart@chef.io>2018-11-09 13:49:22 +0000
committerGitHub <noreply@github.com>2018-11-09 13:49:22 +0000
commit09c332e19d96c2171e99332f3ad221bf614a1674 (patch)
treeef103dcf9a27f4bc371e940afbf22756fad3278d
parent9a3a4d5312d243e8c8e93db8556de462eafa5203 (diff)
parentf78c9cade0e0bae40e1bea14eb662cf245c7993d (diff)
downloadchef-09c332e19d96c2171e99332f3ad221bf614a1674.tar.gz
Merge pull request #7895 from chef/sp/fix7715
windows_ad_join: Switch to UPN format usernames for use with AD cmdlets
-rw-r--r--lib/chef/resource/windows_ad_join.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/resource/windows_ad_join.rb b/lib/chef/resource/windows_ad_join.rb
index 645dab5ad0..b3acacc703 100644
--- a/lib/chef/resource/windows_ad_join.rb
+++ b/lib/chef/resource/windows_ad_join.rb
@@ -65,7 +65,7 @@ class Chef
unless on_domain?
cmd = "$pswd = ConvertTo-SecureString \'#{new_resource.domain_password}\' -AsPlainText -Force;"
- cmd << "$credential = New-Object System.Management.Automation.PSCredential (\"#{new_resource.domain_user}\",$pswd);"
+ cmd << "$credential = New-Object System.Management.Automation.PSCredential (\"#{new_resource.domain_user}@#{new_resource.domain_name}\",$pswd);"
cmd << "Add-Computer -DomainName #{new_resource.domain_name} -Credential $credential"
cmd << " -OUPath \"#{new_resource.ou_path}\"" if new_resource.ou_path
cmd << " -NewName \"#{new_resource.new_hostname}\"" if new_resource.new_hostname