summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-11-09 09:46:32 -0800
committerGitHub <noreply@github.com>2018-11-09 09:46:32 -0800
commitf39ceb0e6a59305e924edf85650371b61ad61ada (patch)
tree78bd6fe421b7972e4b969bc595dd3785fc113ebf
parent3ac713b5c68cf3638dd08f16d0001a1dbc152a86 (diff)
parent53f2356098a80c0b06e7799180886f104661bf96 (diff)
downloadchef-f39ceb0e6a59305e924edf85650371b61ad61ada.tar.gz
Merge pull request #7906 from chef/sp/fix7715-chef-14
Chef 14 Backport: 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