diff options
author | Stuart Preston <stuart@chef.io> | 2018-11-08 20:07:04 +0000 |
---|---|---|
committer | Stuart Preston <stuart@chef.io> | 2018-11-08 20:09:06 +0000 |
commit | f78c9cade0e0bae40e1bea14eb662cf245c7993d (patch) | |
tree | 0c9e4d5320ef7f3fecf37ba6213b55932c0b216b | |
parent | ef186512d36533cafdeadfa83b21d20500029705 (diff) | |
download | chef-f78c9cade0e0bae40e1bea14eb662cf245c7993d.tar.gz |
Switch to UPN format (domain_user@domain_name) to build the credential object for Active Directory cmdletssp/fix7715
Signed-off-by: Stuart Preston <stuart@chef.io>
-rw-r--r-- | lib/chef/resource/windows_ad_join.rb | 2 |
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 |