Set Registry on Multiple Servers in Multiple Forests

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!
IT_Admin XXXXAsked:
Who is Participating?
 
footechConnect With a Mentor 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.
1
 
footechCommented:
Most straight-forward and simple solution provided.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.