Solved

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

Posted on 2010-09-10
1
1,806 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 500 total points
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Set OWA language and time zone in Exchange for individuals, all users or per database.
A safe way to clean winsxs folder from your windows server 2008 R2 editions
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now