How to set windows hostname/FQDN?

I typically use DSC resources for all of my Windows stuff so save me some work. In the case of renaming computers I use the xComputerManagement DSC resource then just use the chef dsc_resource with attributes.

dsc_resource 'RenameComputer' do
  resource :xComputer
  property :Name, node['windows']['computer_name']
end

I should note that the dsc_resource requires WMF5. If you are using WMF4 still then you need to use the dsc_script resource.

1 Like