Solved

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

Posted on 2010-09-10
1
1,966 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
petelettin earned 500 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

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.
After seeing many questions for JRNL_WRAP_ERROR for replication failure, I thought it would be useful to write this article.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…
Suggested Courses

627 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