Set Registry on Multiple Servers in Multiple Forests

IT_Admin XXXX
IT_Admin XXXX used Ask the Experts™
on
Hello there,
Would like to ask for some assistance. I have the following registry updates and would like to do an update to servers' registries in multiple forests. Can someone please shed some light?

invoke-command -Computer (Get-Content "C:\temp\listofservers.txt")
-ScriptBlock {
Set-ItemProperty HKLM:SYSTEM\CurrentControlSet\services\DNS\Parameters -Name EnableGlobalQueryBlockList-Value 0 -Propertytype DWORD -Force
Set-ItemProperty HKLM:SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters -Name SMB1 -Value 0 -PropertyType DWORD -Force
}

Thank you so much for your help!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2014
Commented:
Break your listofservers.txt file into multiple so that each contains only servers of a particular forest.
Then submit the list to Invoke-Command using the -Credential parameter, supplying the necessary credentials for each forest.
Top Expert 2014

Commented:
Most straight-forward and simple solution provided.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial