Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Powershell to copy and execute a .reg file across multiple servers

Posted on 2010-09-10
1
Medium Priority
?
2,044 Views
Last Modified: 2012-08-13
Good Morning,

I am in the need of a powershell script that will add or run a specific reg key which I have exported if it helps here is the key:
-----
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\IniFileMapping\Autorun.inf]
@="@SYS:DoesNotExist"


[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\amsint32]
-----
I would like the powershell script to access a full list of servers and run this across all of them. Is there an easy way to get this done? at this point I will take any recommendations.

Thanks,
Dave
0
Comment
Question by:Betex
1 Comment
 
LVL 3

Accepted Solution

by:
petelettin earned 2000 total points
ID: 33652763
you can use (presuming the key exists)

new-itemproperty -path "hklm:\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\IniFileMapping\Autorun.inf\" -name "@" -propertytype string -value "@SYS:DoesNotExist"

for remote registry download from MSDN http://code.msdn.microsoft.com/PSRemoteRegistry 

where servers.txt contains a list of server names

$Key = "hklm:\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\IniFileMapping\Autorun.inf"
Get-Content servers.txt | Set-RegString -hive LocalMachine -Key $Key -Value "@" -Data "@SYS:DoesNotExist" -Force -PassThru
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

879 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question