summaryrefslogtreecommitdiff
path: root/lib/chef/resource/windows_dfs_server.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/resource/windows_dfs_server.rb')
-rw-r--r--lib/chef/resource/windows_dfs_server.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/chef/resource/windows_dfs_server.rb b/lib/chef/resource/windows_dfs_server.rb
index ae613d931b..8d5eedf441 100644
--- a/lib/chef/resource/windows_dfs_server.rb
+++ b/lib/chef/resource/windows_dfs_server.rb
@@ -2,7 +2,7 @@
# Author:: Jason Field
#
# Copyright:: 2018, Calastone Ltd.
-# Copyright:: 2019-2020, Chef Software Inc.
+# Copyright:: 2019-2020, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -47,14 +47,13 @@ class Chef
default: 3600
load_current_value do
- ps_results = powershell_out("Get-DfsnServerConfiguration -ComputerName '#{ENV["COMPUTERNAME"]}' | Select LdapTimeoutSec, PreferLogonDC, EnableSiteCostedReferrals, SyncIntervalSec, UseFqdn | ConvertTo-Json")
+ ps_results = powershell_exec("Get-DfsnServerConfiguration -ComputerName '#{ENV["COMPUTERNAME"]}' | Select LdapTimeoutSec, PreferLogonDC, EnableSiteCostedReferrals, SyncIntervalSec, UseFqdn").result
if ps_results.error?
raise "The dfs_server resource failed to fetch the current state via the Get-DfsnServerConfiguration PowerShell cmlet. Is the DFS Windows feature installed?"
end
Chef::Log.debug("The Get-DfsnServerConfiguration results were #{ps_results.stdout}")
- results = Chef::JSONCompat.from_json(ps_results.stdout)
use_fqdn results["UseFqdn"] || false
ldap_timeout_secs results["LdapTimeoutSec"]
@@ -67,7 +66,7 @@ class Chef
description "Configure DFS settings."
converge_if_changed do
- powershell_out("Set-DfsnServerConfiguration -ComputerName '#{ENV["COMPUTERNAME"]}' EnableSiteCostedReferrals $#{new_resource.enable_site_costed_referrals} -UseFqdn $#{new_resource.use_fqdn} -LdapTimeoutSec #{new_resource.ldap_timeout_secs} -PreferLogonDC $#{new_resource.prefer_login_dc} -SyncIntervalSec #{new_resource.sync_interval_secs}")
+ powershell_exec("Set-DfsnServerConfiguration -ComputerName '#{ENV["COMPUTERNAME"]}' EnableSiteCostedReferrals $#{new_resource.enable_site_costed_referrals} -UseFqdn $#{new_resource.use_fqdn} -LdapTimeoutSec #{new_resource.ldap_timeout_secs} -PreferLogonDC $#{new_resource.prefer_login_dc} -SyncIntervalSec #{new_resource.sync_interval_secs}")
end
end
end