From 53f2356098a80c0b06e7799180886f104661bf96 Mon Sep 17 00:00:00 2001 From: Stuart Preston Date: Fri, 9 Nov 2018 14:04:35 +0000 Subject: windows_ad_join: Switch to UPN format usernames for use with AD cmdlets Signed-off-by: Stuart Preston --- lib/chef/resource/windows_ad_join.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.1