Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2010-09-10
1
Medium Priority
?
2,015 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 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
For anyone that has accidentally used newSID with Server 2008 R2 (like I did) and hasn't been able to get the server running again because you were unlucky (as I was) and had no backups - I was able to get things working by doing a Registry Hive rec…
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…
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 …

670 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